Copy link to clipboard
Copied
I am looking for a way to batch print only the first page of multiple PDF's on a Windows System. I made an extensive online search but I either need to use ACTIONS Adobe Acrobat PRO (we have standard) or they didn't help.
Any suggestions? Thanks...
1 Correct answer
You can do it with a simple VBScript (I wrote some years ago).
Save the attached script as AcroPrintFirst.vbs on the desktop.
Then you can drag & drop pdf files on it,
The first page will be printed to the standard printer.
Enjoy, Reinhard
AcroPrintFirst.vbs
'//Print first page of pdfs
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
Se
...Copy link to clipboard
Copied
You answered your own question. It requires Acrobat Pro.
Copy link to clipboard
Copied
How would you accomplish this using Adobe pro please? Thanks in advance!
Copy link to clipboard
Copied
Create an Action that executes this code:
this.print(false, 0, 0, true);
Copy link to clipboard
Copied
I've tried this, but it's only printing the first page of the pdf I'm currently on. Is there a way to have it print the first page of all my open pdfs? Or am I just doing something wrong
Copy link to clipboard
Copied
Did you set the Action to process all open files?
Copy link to clipboard
Copied
If you know how to program in JavaScript, you can - even with Acrobat Standard - create a document level script the e.g. adds a menu item to Acrobat's menu (or a tool button to it's tools area), and then do your batch printing from such a script. The problem is that you need to pass in the names of the field you want to process.
Take a look at the Dpc.print() method for information about how to specify just one page. You can also find the necessary one line script in probably any forum post that references the actions wizard (e.g. here: Printing only first page of multiple PDF's )
The only real problem you will run into is that Acrobat Standard has no simple way of brining up the JavaScript console/debugger. See here for information about how to get around this: Access Javascript console in Acrobat X STANDARD (JavaScript)
At the end, you have to ask yourself how much money your time is worth, and it you might not be better off just paying the upgrade fee to Acrobat Pro. As you can see, it's much easier to do this with the Action Wizard.
Copy link to clipboard
Copied
Thanks...sadly, management doesn't want to pay a dime, so they are challenging me to come up with a free solution.
Copy link to clipboard
Copied
That's known as "Penny wise, Pound foolish"... How much money are they wasting on you doing the research? And on doing this task manually (which you'll probably end up doing)? Probably more than what it would cost to upgrade to Acrobat to do this task automatically.
Copy link to clipboard
Copied
You can do it with a simple VBScript (I wrote some years ago).
Save the attached script as AcroPrintFirst.vbs on the desktop.
Then you can drag & drop pdf files on it,
The first page will be printed to the standard printer.
Enjoy, Reinhard
AcroPrintFirst.vbs
'//Print first page of pdfs
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
Set gApp = CreateObject("AcroExch.App")
gApp.show '<- comment or take out to work in hidden mod
'open via Avdoc and print
for i=0 to objArgs.Count - 1
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
Copy link to clipboard
Copied
Rheinhard your VBSscript works great, but does require me to confirm the printing for each pdf. Is it supposed to run all the PDFs as a batch, or is that possible? Thanks!
Copy link to clipboard
Copied
So I used this script for years, thank you. But all of a sudden, it stopped working with the latest Adobe Acrobat update (I think that is the cause)...it fails at line 25 which is
Set AVDoc = CreateObject("AcroExch.AVDoc")
This is actually urgent as our VP uses this many times a week.
Has anyone else encountered this?
Copy link to clipboard
Copied
It is possible to write a script to do this using a text editor and the JavaScript console but one will need to specify the file path and file names to process.
As noted it can be done with VBA or other computer languages and on a Macintosh one can even use Apple Script to perform the task.

