When working with command line printing of PDFs, users may encounter various issues such as incorrect text rendering, hyperlinks being highlighted, and color settings not behaving as expected. One of the tools that help automate this process is PDFPrint Command Line, a utility that provides numerous options for printing PDFs directly from the command line. However, it can sometimes be tricky to achieve the desired output, especially when aiming for high-quality prints without unnecessary artifacts.
In this article, we’ll explore a case study of a user’s challenge with PDFPrint and provide guidance on how to address common printing issues such as distorted text, incorrect bullet points, clickable areas being improperly rendered, and difficulties with color settings.
https://www.verypdf.com/app/pdf-print-cmd/index.html
The Problem
The user was testing the PDFPrint Command Line tool and encountered several issues when printing a PDF document. They used a series of commands to print the document to both a physical printer and a "Microsoft Print to PDF" virtual printer to generate an output on disk.
Initial Command:
pdfprint.exe -$ "{our key}" "-printer" "{our printer}" "{our pdf file}" -orient 1 -color 1 -duplex 1 -printtofile "{out on disk output}"
Here’s what was observed in the output:
- Text appeared thicker than expected.
- Slight stretching of the document vertically.
- Hyperlinks had visible rectangles around them.
- Bullet points were rendered incorrectly.
- The color setting (-color 1) was not honored, and images weren’t rendered in monochrome, as expected.
After some testing, the user found that adding the -raster option to the command improved the output in terms of color and text rendering, but did not fully address the other issues.
Improved Command with -raster:
pdfprint.exe -$ "{our key}" "-printer" "{our printer}" "{our pdf file}" -orient 1 -color 1 -duplex 1 -printtofile "{out on disk output}" -raster
- Output became monochrome (color was no longer an issue).
However, other issues persisted, especially the printing of hyperlinks and bullet points.
The Solution
The user was advised to try a more refined command with the following settings to address these issues:
Refined Command:
pdfprint.exe -$ "{our key}" "-printer" "{our printer}" "{our pdf file}" -orient 1 -color 1 -duplex 1 -printtofile "{out on disk output}" -raster2 -raster2aa yes
With these additional options, some improvements were noticed:
- Thicker text was resolved.
- Bullet points rendered correctly.
- Rectangles around clickable areas (hyperlinks) no longer appeared.
However, the color setting (-color 1) was still not properly honored, and the document was printed in color despite the monochrome expectation.
The Final Command for Optimal Quality
To achieve the best quality and solve the remaining issues, the following settings were recommended:
Final Command:
pdfprint.exe -raster2 -rasterbwtext -rasterbitcount 1 -xres 150 -yres 150 C:\input.pdf
With these adjustments:
- Thicker text is resolved, ensuring a clean, readable output.
- Bullet points appear correctly, preserving the layout as intended.
- Clickable areas (such as hyperlinks) are no longer surrounded by rectangles.
- Monochrome printing is enforced with the -rasterbwtext setting.
- Color rendering issues are eliminated, with all content now printed as monochrome.
Why These Settings Work
- -raster2: This option ensures the document is processed using raster-based printing, which helps avoid issues like distorted text and incorrect rendering of certain graphic elements.
- -rasterbwtext: Forces black-and-white rendering for text, addressing the problem of text color when monochrome is expected.
- -rasterbitcount 1: Ensures that the output is truly monochrome by specifying a bit count of 1, making the output consistent with the black-and-white requirement.
- -xres 150 and -yres 150: These resolution settings ensure that the image quality is appropriate for printing. Reducing resolution can help avoid quality degradation, especially when printing larger paper sizes.
Conclusion
If you are experiencing similar issues with PDFPrint Command Line, using the above suggestions should help you achieve the best results. By fine-tuning the settings such as -raster2, -rasterbwtext, and adjusting the resolution, you can resolve common problems like thick text, incorrect bullet points, and issues with color settings. If you continue to experience problems, consider providing your PDF examples to further troubleshoot any issues.
As always, ensure that you are using the latest version of PDFPrint to take advantage of new updates and improvements.
Original questions and answers,
Hi,
I am looking for guidance around PDFPrint Command line options.
We have been tying different setting but have run into a few challenges. I have detailed our attempts below comparing the output from pdfprint with that of printing the same PDF from Edge. We have performed tests to both a physical printer and "Microsoft Print to PDF" to get a version on disk
Command:
pdfprint.exe -$ "{our key}" "-printer" "{our printer}" "{our pdf file}" -orient 1 -color 1 -duplex 1 -printtofile "{out on disk output}"
Comments:
- Text is thicker
- Looks to me ever so slightly stretched downwards
- Clickable objects on the PDF such as hyperlinks causes rectangles to be drawn around them.
- Bullet points being rendered incorrectly
- Image is not mono even though -color set to 1
Adding "-raster" to the command does address one of the issue,
Command:
pdfprint.exe -$ "{our key}" "-printer" "{our printer}" "{our pdf file}" -orient 1 -color 1 -duplex 1 -printtofile "{out on disk output}" -raster
Comments:
- Output is now Monochrome
Command:
pdfprint.exe -$ "{our key}" "-printer" "{our printer}" "{our pdf file}" -orient 1 -color 1 -duplex 1 -printtofile "{out on disk output}" -orient 1 -color 1 -duplex 1 -printtofile "C:\Program Files\Synertec Limited\File System Transfer\Printed\Output\Rasta.pdf" -raster2 -raster2aa yes
Comments:
- Thicker text is resolved
- Bullet points are correct
- No rectangles drawn over clickable areas
- Color 1 is still not honoured (prints colour when monochrome is expected)
From our testing we believe the best quality to be achieved through the following settings, -Raster2, -Raster2aavec & -enhancethinlines. The issue remains however that we are unable to control the colour via -color 1 and we are having to print as a raster image which we are concerned may cause quality problems if printed to larger paper types.
Please can you advise on the correct usage and suggest settings to use. I can of course provide examples of the PDFs we are using as well as our generated outputs.
Many thanks,
Customer
------------------------------------------
Thanks for your message, we suggest you may use following options to print your PDF file to try again,
pdfprint.exe -raster2 -rasterbwtext -rasterbitcount 1 -xres 150 -yres 150 C:\input.pdf
This command line will solve the below issues,
- Thicker text is resolved
- Bullet points are correct
- No rectangles drawn over clickable areas
- Prints colour as monochrome
Please feel free to let us know if you have any problem with above new command line.