我有一个很好和整洁的VBS脚本,它从所有被拖到这个VBS的文档中打印前5页。
set WshShell = CreateObject ("Wscript.Shell")
set fs = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments
if objArgs.Count < 1 then
msgbox("Please drag a file on the script")
WScript.quit
end if
'contact Acrobat
Set gApp = CreateObject("AcroExch.App")
gApp.show 'comment or take out to work in hidden mode
'open via Avdoc and print
for i=0 to objArgs.Count - 5
FileIn = ObjArgs(i)
Set AVDoc = CreateObject("AcroExch.AVDoc")
If AVDoc.Open(FileIn, "") Then
Set PDDoc = AVDoc.GetPDDoc()
Set JSO = PDDoc.GetJSObject
jso.print false, 0, 0, true
gApp.CloseAllDocs
end if
next
gApp.hide : gApp.exit : Quit()
MsgBox "Done!"
Sub Quit
Set JSO = Nothing : Set PDDoc = Nothing : Set gApp =Nothing : Wscript.quit
End Sub我的问题是关于设置。
我想知道如何设置这个VBS将打印前6页作为双面,等等。是否有可用设置的列表?
发布于 2016-11-11 14:03:57
丹尼斯,--如果你改变了
"for i=0 to objArgs.Count - 5“(不打印最后4个文件)
for i=0 to objArgs.Count - 1和"jso.print false,0,0,true“(只打印第一页)到
jso.print false, 0, 4, true然后脚本就会按照你的设想来做。
如果要打印双面打印,则必须使用js print参数pageHandling。“每页多页是通过将pageHandling设置为nUp获得的。”你必须决定是用"nUpNumPagesH“来表示垂直布局,还是使用"nUpNumPagesV”来表示垂直布局--或者两者兼用。
这里有一个例子和解释(在nUpNumPagesH下):AcroJS.88.981.html&accessible=true
该示例是用Acro-js代码编写的。您必须在VBS中转换为jso (JavaScript对象),然后脚本应该做您想做的事情。
如果你需要更多的帮助,不要犹豫,莱因哈德
PS:到那时,您可以在Acro JS帮助文件/ JS引用中读取一些您使用的语句:-)
https://stackoverflow.com/questions/40543699
复制相似问题