Skip to main content
BrianWolt
Participant
May 3, 2016
Answered

How Can I Batch Print Only 1st Page of Multiple PDF's?

  • May 3, 2016
  • 2 replies
  • 12283 views

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...

This topic has been closed for replies.
Correct answer ReinhardF

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

2 replies

Karl Heinz  Kremer
Community Expert
Community Expert
May 3, 2016

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.

BrianWolt
BrianWoltAuthor
Participant
May 3, 2016

Thanks...sadly, management doesn't want to pay a dime, so they are challenging me to come up with a free solution.

try67
Community Expert
Community Expert
May 3, 2016

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.

try67
Community Expert
Community Expert
May 3, 2016

You answered your own question. It requires Acrobat Pro.

mustansirg1g
Participant
January 10, 2017

How would you accomplish this using Adobe pro please? Thanks in advance!

try67
Community Expert
Community Expert
January 10, 2017

Create an Action that executes this code:

this.print(false, 0, 0, true);