Am 08.11.2017 um 19:25 schrieb Thorsten Schöning:
Guten Tag Tilman Hausherr,
am Mittwoch, 8. November 2017 um 17:26 schrieben Sie:

This is a known problem sometimes and there's a workaround (use a fixed dpi)
https://issues.apache.org/jira/browse/PDFBOX-3046
Thanks, that was exactly what I was seeing. Printing using the "-dpi"
argument with "300" on the shell dropped memory footprint to around
400 MB and processed the job in around 2 seconds.

java -jar "pdfprint.jar" PrintPDF -silentPrint "C:\[...]\0001-print5B7A1242.pdf" -dpi 
"300"
Is there an easy way I could detect those PDFs before actually
printing them to be able to provide "-dpi" only if necessary? Memory

Sadly, no.

footprint without "-dpi 300" where not necessary is better for my test
doc with 10 pages, around 225 to 600 MB. Seems to scale by page and my
customer sometimes needs to print docs with 50 and more pages. Not
that important, though, as most of his users has at least 8 GB of
RAM.

BTW, it seems that not all supported args by the command line app are
documented yet. I only found out because I had a look at the source.

https://pdfbox.apache.org/2.0/commandline.html#printpdf
https://github.com/apache/pdfbox/blob/trunk/tools/src/main/java/org/apache/pdfbox/tools/PrintPDF.java#L38

Well you could also have entered it without parameters and get the usage.


@Maruan can you add it?

-border Print with border
-dpi Render into intermediate image with specific dpi and then print"




BTW 2, it seems to me that the command line app is printing using
Scaling.ACTUAL_SIZE while in your bug SHRINK_TO_SIZE is preferred.

https://github.com/apache/pdfbox/blob/trunk/tools/src/main/java/org/apache/pdfbox/tools/PrintPDF.java#L162
https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/printing/PDFPageable.java#L165
https://issues.apache.org/jira/browse/PDFBOX-3046?focusedCommentId=14980954&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14980954

Sorry I don't understand.


Did you set the option mentioned here?
https://pdfbox.apache.org/2.0/getting-started.html
Tried that as well just to be sure, but didn't change a thing. A
combination of those and "-dpi" seems to even be a bit slower than
"-dpi" alone, something around half a second. So "-dpi" seems to be
the proper solution for me as well.

The next version will have it... you'll see the differences if CMYK or icc colorspaces are used.

Tilman



Mit freundlichen Grüßen,

Thorsten Schöning


Reply via email to