How I Handle Printing Specific Page(s): Note: I only use this when needing to print specific pages as it opens UI and uses SENDKEYS = unreliable, but only/best option for specific pages. But when I print the whole doc, I don't use VBS so therefor this method REQUIRES the argument for pages in the format of "2" or "1-2". Accepts OPTIONAL DUPLEXSENDKEYS as arg to setup Duplex Printing!
Note: I tried setting "orientation", but adobe doesn't honor anything if "Auto" is selected and there is no way to determine what is selected (you can just keep looping pressing right) Update, you can set it via "page setup", but I'm done improving my Batch/VBS Hybring stuff, please see POWERSHELL PRINT for better solutions.
I also tried setting greyscale, but adobe remembers last setting, so again, no way to reset to default. If you really need/want, I'd recommend setting up additional printers w/ new default settings and see how that goes, but I have enough options for my needs (probably more, I went a little overkill on my print projects...)
You can use `print.exe` but I wouldn't advise it.
I found that "print" caused issues with some PDF's like when I split a pdf into specific pages via "Microsoft Print to PDF". So, I now use "
AcroRd32.exe" which is apparently unsupported/undocumented (except on SO of course!), but works much better.
The following switches are available:
/n- Launch a new instance of Reader even if one is already open
/s- Don't show the splash screen
/o- Don't show the open file dialog
/h- Open as a minimized window
/p <filename>- Open and go straight to the print dialog
/t <filename> <printername> <drivername> <portname>- Print the file the specified printer. 'Note
<printername> <drivername> <portname> are all optional
/a - "Open Parameter" --> https://www.evermap.com/AutoBookmark/Manual/OpenParameters.htm
Syntax definition Description nameddest=name Specifies a named destination in the PDF.
where chapter1 is a named destionation
page=pagenum Specifies a numbered page in the document, using an integer value. The document’s first page has a pagenum value of 1. comment=commentID Specifies a comment on a given page in the PDF. Use the page command before this command; for example: #page=1&comment=452fde0e-fd22-457c-84aa-2cf5bed5a349 zoom=scale
Sets the zoom and scroll factors, using float or integer values. For example, a scale value of 100 indicates a zoom value of 100%. Scroll values left and top are in a coordinate system where 0,0 represents the top left corner of the visible page, regardless of document rotation. view=Fit
Set the view of the displayed page, using the keyword values defined in the PDF language specification. See the PDF Reference. Scroll values left and top are floats or integers in a coordinate system where 0,0 represents the top left corner of the visible page, regardless of document rotation. Use the page command before this command.
NOTE:Not supported on the command line.
viewrect=left,top,wd,ht Sets the view rectangle using float or integer values in a coordinate system where 0,0 represents the top left corner of the visible page, regardless of document rotation. Use the page command before this command. NOTE:Not supported on the command line. pagemode=bookmarks
Displays bookmarks or thumbnails. scrollbar=1|0 Turns scrollbars on or off. search=wordList Opens the Search UI and performs a search for the specified word list in the document. Matching words are highlighted in the document. The words must be enclosed in quotes and separated by spaces; for example: #search=”word1 word2” statusbar=1|0 Turns the status bar on or off. messages=1|0 Turns the document message bar on or off. navpanes=1|0 Turns the navigation panes and tabs on or off. highlight=lt,rt,top,btm Highlights a specified rectangle on the displayed page. (Use the page command before this command.) The rectangle values are integers in a coordinate system where 0,0 represents the top left corner of the visible page, regardless of document rotation. help=index|contents|search Used only when opening a file from the command line or an Apple Event. Opens the document in the Help window, with the specified navigation panel selected. fdf=URL Specifies an FDF file to be used to populate form fields in the PDF file being opened.
For example: #fdf=http://example.org/doc.fdf
NOTE:The fdf parameter should be specifed last in the URL.
collab=setting Sets the collaboration store to be used to supply and store comments for the document. This overrides the default comment server for the review or the default preference. setting is of the form store_type@location, where valid values for store_type are:
?FSFDF (Network store)
?DB (ADBC) For example: #collab=DAVFDF@http://review_server/Collab/user1 For more information, see Acrobat Online Collaboration: Administration and Setup.
- Adobe hangs after printing, so you must use "Start" for each print job which starts it's own thread or script will hang
- Start looks for window title first, so you must use "" after start. Eg START "" "C:\Adobe"...
- To select Portrait/Landscape, open Adobe, Print → Orientation → Auto → Print. Now next time it should automatically use the best/correct orientation. You can use Adobe pro to set orientation, but this works fine in my testing.
- I couldn't get Wildcards in Filenames to work, haven't debugged yet.