[ 
https://issues.apache.org/jira/browse/PDFBOX-4942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17185416#comment-17185416
 ] 

Jon Ominsky commented on PDFBOX-4942:
-------------------------------------

[~tilman] Thank you for the follow up and the explanation. Our client base is 
large, and we do not know what kinds of PDF documents will be encountered. 
We've decided to make our calls to PDFBox configurable in such a way that his 
can be controlled via a ".properties" file. For many clients, the standard 

{code}
PDFPageable pageable = new PDFPageable(document);
{code}

works fine, but for others, they run into problems (like this one and there 
have been others). So, we've basically changed to the following to allow our 
clients to work-around the issue knowing that there is a trade off as the DPI 
gets larger, so does the print spool size and time to print.

{code}
PDFPageable pageable = new PDFPageable(document, Orientation.AUTO, false, 
<configured DPI value>);
{code}

Thanks for your time looking into this.

> Printing PDF hangs and document is never printed
> ------------------------------------------------
>
>                 Key: PDFBOX-4942
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4942
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.21
>            Reporter: Jon Ominsky
>            Priority: Critical
>              Labels: print, printing
>         Attachments: problem.pdf
>
>
> We have an integration that simply prints PDFs. The PDF attached never prints 
> and clogs up the print queue - just ends up spooling for very long periods of 
> time. Code in question that is in use with the latest version of PDFBox:
> {code:java}
>     PrintService service = getPrintService(printerName);
>     DocPrintJob printJob = service.createPrintJob();    
> PrintRequestAttributeSet attrSet = new HashPrintRequestAttributeSet();
>     attrSet.add(new JobName(fileName, null));
>     attrSet.add(new Copies(1));    
>     try (PDDocument pdf = PDDocument.load(file)) {
>       PDFPageable pageable = new PDFPageable(pdf);
>       Doc doc = new SimpleDoc(pageable, DocFlavor.SERVICE_FORMATTED.PAGEABLE, 
> null);
>       printJob.print(doc, attrSet);      return new 
> PdfPrintResult(pdf.getNumberOfPages());
>     } catch (IOException | PrintException e) {
>       throw new ControlledPrintException("Unable to print file " + fileName + 
> ".", e);
>     } 
> {code}
> This occurs trying to print to a physical printer as well as to a PDF 
> Printer, e.g., PDFCreator. I am able to open the PDF in the PDFDebugger and 
> view it, but cannot determine what is causing the issue.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to