我在办公室使用以下脚本将多个 word 文件转换为 pdf 有谁知道如何在此脚本中提高 pdf 的分辨率?
请注意,在这个问题的第一个版本中,我尝试使用 objDoc.savesas 生成低分辨率的 pdf。我现在正在尝试使用 ExportAsFixedFormat 导出以创建具有打印分辨率的 pdf。我使用以下命令不断收到此脚本的错误:Set objDoc = objWord.documents.open(docPath)
Set fso = CreateObject("Scripting.FileSystemObject")
Const wdExportAllDocument = 0
Const wdExportOptimizeForPrint = 0
Const wdExportDocumentContent = 0
Const wdExportFormatPDF = 17
Const wdExportCreateHeadingBookmarks = 1
For i= 0 To WScript.Arguments.Count -1
docPath = WScript.Arguments(i)
docPath = fso.GetAbsolutePathName(docPath)
If LCase(Right(docPath, 4)) = ".doc" Or LCase(Right(docPath, 5)) = ".docx" Then
Set objWord = CreateObject("Word.Application")
pdfPath = fso.GetParentFolderName(docPath) & "\" & _
fso.GetBaseName(docpath) & ".pdf"
objWord.Visible = False
Set objDoc = objWord.documents.open(docPath)
pdf = objDoc.ExportAsFixedFormat( _
WScript.Arguments(1), _
wdExportFormatPDF, False, wdExportOptimizeForPrint, _
wdExportAllDocument,,, _
wdExportDocumentContent, _
False, True, _
wdExportCreateHeadingBookmarks _
)
'objDoc.saveas pdfPath, 17
objDoc.Close
objWord.Quit
End If
Next