PowerPoint 转 PDF:最小尺寸选项

PowerPoint to PDF: Minimum size option

我尝试使用 PowerShell 将 PowerPoint 文件转换为 PDF,并且成功了。但是,我正在尝试更进一步,并通过脚本 select 'Minimum Size (publishing online)' 选项。

是否需要设置 属性 才能发生这种情况?我猜这是 $ppQualityStandard 变量,但不确定。

编辑:这是我目前使用的:

function ppt_to_pdf ($folderpath, $pptname) {
    Add-Type -AssemblyName office
    $ppFormatPDF = 2
    $ppQualityStandard = 0
    $p = New-Object -ComObject PowerPoint.Application
    $p.Visible = [Microsoft.Office.Core.MsoTriState]::msoTrue
    $ppt = $p.Presentations.Open("$folderpath$pptname")
    $ppt.SaveCopyAs("$folderpath$pptname", 32)
    $ppt.Close()
    $p.Quit()
    $p = $null
    [gc]::collect()
    [gc]::WaitForPendingFinalizers()
}

我怀疑您需要使用 .ExportAsFixedFormat 而不是 .SaveCopyAs

除其他参数外,它采用 Intent 作为类型 ppFixedFormatIntent,可以是:

ppFixedFormatIntentScreen (=1)

ppFixedFormatIntentPrint (=2)

还有许多其他参数。要了解更多信息,请启动 PPT,进入 VBA IDE 并按 F2 进入对象浏览器并搜索 ExportAsFixedFormat