You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Donald Whytock <dw...@apache.org> on 2017/03/23 17:10:23 UTC

Long printing times

Hi all...

I'm checking out PDFBox printing capability using a 32-page PDF.  The good
news is that the PDF prints perfectly.  The bad news is that it takes over
half an hour.

To better understand the situation, I added some logging to the
PDFPrintable class.  Half the pages printed almost instantly; the other
half averaged six minutes per page.

While PDFPrintable.print() was called twice for each quick page, it was
called over 1,800 times for one page.  Logging the graphics parameter
as graphics.getClip().toString() showed each call was for a different
region of the page.  At eight minutes for the page, that's roughly five
calls executed per second.

I don't know what produced the PDF, and probably have no influence in its
use.  Is this performance what I should expect?

Thanks...

Don

Re: Long printing times

Posted by Donald Whytock <dw...@apache.org>.
PDFBox version 2.0.5.

The file in question is proprietary data.  I'm trying to produce a
functionally equivalent test copy.

Haven't tried PDFDebugger yet.  I'll try it and let you know.

Thanks.

On Thu, Mar 23, 2017 at 1:34 PM, Andreas Lehmkuehler <an...@lehmi.de>
wrote:

> Hi,
>
> Am 23.03.2017 um 18:10 schrieb Donald Whytock:
>
>> Hi all...
>>
>> I'm checking out PDFBox printing capability using a 32-page PDF.  The good
>> news is that the PDF prints perfectly.  The bad news is that it takes over
>> half an hour.
>>
>> To better understand the situation, I added some logging to the
>> PDFPrintable class.  Half the pages printed almost instantly; the other
>> half averaged six minutes per page.
>>
>> While PDFPrintable.print() was called twice for each quick page, it was
>> called over 1,800 times for one page.  Logging the graphics parameter
>> as graphics.getClip().toString() showed each call was for a different
>> region of the page.  At eight minutes for the page, that's roughly five
>> calls executed per second.
>>
>> I don't know what produced the PDF, and probably have no influence in its
>> use.  Is this performance what I should expect?
>>
>> Thanks...
>>
>
> What version of PDFBox are you using?
> Coudl you provide us with the pdf in question (upload it somewhere to a
> public place or mail it to one of the devs if you can't share it in public.
>
> Did you try to render it using PDFDebugger? If so, do you see some
> differences when rendering those problematic pages?
>
>
>> Don
>>
>
> BR
> Andreas
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: dev-help@pdfbox.apache.org
>
>

Re: Long printing times

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Am 23.03.2017 um 18:10 schrieb Donald Whytock:
> Hi all...
>
> I'm checking out PDFBox printing capability using a 32-page PDF.  The good
> news is that the PDF prints perfectly.  The bad news is that it takes over
> half an hour.
>
> To better understand the situation, I added some logging to the
> PDFPrintable class.  Half the pages printed almost instantly; the other
> half averaged six minutes per page.
>
> While PDFPrintable.print() was called twice for each quick page, it was
> called over 1,800 times for one page.  Logging the graphics parameter
> as graphics.getClip().toString() showed each call was for a different
> region of the page.  At eight minutes for the page, that's roughly five
> calls executed per second.
>
> I don't know what produced the PDF, and probably have no influence in its
> use.  Is this performance what I should expect?
>
> Thanks...

What version of PDFBox are you using?
Coudl you provide us with the pdf in question (upload it somewhere to a public 
place or mail it to one of the devs if you can't share it in public.

Did you try to render it using PDFDebugger? If so, do you see some differences 
when rendering those problematic pages?

>
> Don

BR
Andreas



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Re: Long printing times

Posted by Donald Whytock <dw...@gmail.com>.
Got it, yes.

            printJob.setPageable(new PDFPageable(document, orientation,
false, 300));

Works much better now.  Thanks!

On Thu, Mar 23, 2017 at 2:54 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

> Am 23.03.2017 um 19:41 schrieb Donald Whytock:
>
>> On Thu, Mar 23, 2017 at 1:47 PM, Tilman Hausherr <TH...@t-online.de>
>> wrote:
>>
>> workaround: set dpi > 0, e.g. 300 or 600.
>>>
>>> Tilman
>>>
>>>
>>> Anything more complex than this?  Because it doesn't seem to make a
>> difference.
>>
>>          PrintRequestAttributeSet jobattributes = new
>> HashPrintRequestAttributeSet();
>>          jobattributes.add(new PrinterResolution(300, 300,
>> PrinterResolution.DPI));
>>          printJob.print(jobattributes);
>>
>>
> Sorry, I meant the dpi parameter in the constructor of PDFPageable or
> PDFPrintable
>
>
>
> Tilman
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: dev-help@pdfbox.apache.org
>
>

Re: Long printing times

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 23.03.2017 um 19:41 schrieb Donald Whytock:
> On Thu, Mar 23, 2017 at 1:47 PM, Tilman Hausherr <TH...@t-online.de>
> wrote:
>
>> workaround: set dpi > 0, e.g. 300 or 600.
>>
>> Tilman
>>
>>
> Anything more complex than this?  Because it doesn't seem to make a
> difference.
>
>          PrintRequestAttributeSet jobattributes = new
> HashPrintRequestAttributeSet();
>          jobattributes.add(new PrinterResolution(300, 300,
> PrinterResolution.DPI));
>          printJob.print(jobattributes);
>

Sorry, I meant the dpi parameter in the constructor of PDFPageable or 
PDFPrintable


Tilman


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Re: Long printing times

Posted by Donald Whytock <dw...@apache.org>.
On Thu, Mar 23, 2017 at 1:47 PM, Tilman Hausherr <TH...@t-online.de>
wrote:

>
> workaround: set dpi > 0, e.g. 300 or 600.
>
> Tilman
>
>
Anything more complex than this?  Because it doesn't seem to make a
difference.

        PrintRequestAttributeSet jobattributes = new
HashPrintRequestAttributeSet();
        jobattributes.add(new PrinterResolution(300, 300,
PrinterResolution.DPI));
        printJob.print(jobattributes);

Re: Long printing times

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 23.03.2017 um 18:10 schrieb Donald Whytock:
> Hi all...
>
> I'm checking out PDFBox printing capability using a 32-page PDF.  The good
> news is that the PDF prints perfectly.  The bad news is that it takes over
> half an hour.
>
> To better understand the situation, I added some logging to the
> PDFPrintable class.  Half the pages printed almost instantly; the other
> half averaged six minutes per page.
>
> While PDFPrintable.print() was called twice for each quick page, it was
> called over 1,800 times for one page.  Logging the graphics parameter
> as graphics.getClip().toString() showed each call was for a different
> region of the page.  At eight minutes for the page, that's roughly five
> calls executed per second.

Known java problem, see Petrs comment:
https://issues.apache.org/jira/browse/PDFBOX-3046

workaround: set dpi > 0, e.g. 300 or 600.

Tilman



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org