Link to home
Start Free TrialLog in
Avatar of James
JamesFlag for Canada

asked on

Looking for a good command-line PDF printer

What do you recommend for a good command-line PDF printer? I need to be able to specify scaling (and possibly paper size). My preference is for something with as little overhead as possible - I don't need any kind of GUI, etc. I'm just using this to take already created PDF's and send them to a Zebra label printer. A free program would be nice, but I'm happy to buy one provided I can test it first.

So far I've tried Fox-It and Summatra but they are both weirdly lopping off the top and/or bottom of my PDF's when I invoke them from a command line. (They print them perfectly if I open then program and print the PDF from there.)

Thanks in advance.
Avatar of Harjit Dhaliwal
Harjit Dhaliwal
Flag of United States of America image

Have you looked at PDFCreator?

https://www.pdfforge.org/pdfcreator
Avatar of Brandon Lyon
Brandon Lyon

Which operating system are you looking for? Windows, OSX, Linux ( distro? )...?
Try this free software: https://community.coherentpdf.com

If after testing you want to use it in production (non personal use, i.e. business use), buy a license here: https://www.coherentpdf.com
Avatar of James

ASKER

I'm actually looking for something that will just send a PDF to a specified printer. I already have the PDF's and don't need to manipulate them at all ... I just need to be able to execute a command line command that will send the PDF to the printer I specify.

(That being said, Coherent PDF looks like an excellent tool for manipulating PDF's. I will definitely look into this for other projects I have. Thank you for letting me know about it.)

In answer to the other question, I'm working in Windows.
Adobe reader can already send print PDF's to any printer from the command line.
However, whenever I use it, I built it around my own app, that kills the Adobe session after xx amount of time (usually based on how big the PDF file is).
I use Adobe Reader because sadly it has to do with some exact layout stuff, and found it didn't close itself automatically.
Therefore you could also try Foxit Reader's command line to print. https://www.foxitsoftware.com/downloads/
foxitreader.exe /t c:\fullpath\topdf.pdf printer_name
Avatar of James

ASKER

Thanks again. I'm having a further problem no matter what PDF viewer/printer I use.

I'm generating PDF's that are 4" x 8.25". I'm printing these on a Zebra label printer.

When I try printing the PDF from the command line with any viewer (Acrobat Reader, Foxit, Summatra, PDF-Exchange), the top and bottom get lopped off the PDF.

I'm 99% sure the problem has to do with paper sizing. When I load the PDF in any of the viewers, it defaults to 4" x 6.5". Here's what it looks like:

User generated image
And the greyed-out areas are the parts that don't print on the label. I need to go into the the properties in the print dialog and choose the right paper size. Then it will print fine from the viewer. But it still doesn't print properly from the command line.

I've gone into the printer settings in Windows and set it to be 4" x 8.25" by default but the viewers all ignore that. They all default to 4" x 6.5". The print dialog shows that it knows the PDF is 4" x 8.25" but the print area is always 4" x 6.5"

Any suggestions?
Acrobat's command line print is no longer supported by Adobe, so it may stop working at any time.

PDF-Xchange has command line options to send a PDF to your printer. The command also lets you specify the printer, the pages to print, whether the print dialogue box should show or not, and whether to use default or saved print parameters. This last one should get around your sizing problem.

For private use it's a free download, and it's my favourite PDF viewer.
ASKER CERTIFIED SOLUTION
Avatar of Kimputer
Kimputer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial