0

I am scripting printing PDF's via simple print D:\\server\printer file.pdf command and it works, but I'd like to print only the first X pages in some instances or the last page etc.

Is there a way to specify pages? Perhaps I need to use Adobes executable to print and/or just manually split files myself ahead of time (The files are generally static "onboarding" files).

Thanks.

FreeSoftwareServers
  • 2,271
  • 1
  • 33
  • 57

2 Answers2

1

Win2PDF has a command line that can print a range of documents:

win2pdfd.exe printpdf "sourcefile" printername startpage endpage

More information is at: https://www.win2pdf.com/doc/command-line-print-pdf.html

Craig Lebakken
  • 1,853
  • 15
  • 10
0

Well, I found no way to specify pages when printing, but thankfully my print jobs are mostly static. There is likely a way to script splitting files via "Microsoft Print to PDF" but I did that manually and printed the pages I wanted to a new PDF.

Ironically, the print command didn't work with PDF's generated via this method, so I switched to printing via AcroRd32.exe

Update: I figured it out using VBS, posted on this question as it has most views and flagged this and another as dups.

https://stackoverflow.com/questions/38698411/print-a-specific-pdf-page-using-command-line#:~:text=No.,displays%20the%20Print%20dialog%20box

Adobe Reader Command Line Reference

FreeSoftwareServers
  • 2,271
  • 1
  • 33
  • 57