You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Alex Sviridov <oo...@mail.ru> on 2015/06/28 18:05:59 UTC

Re[2]: PDFBox 2.0 how to print certain page

 Thank you for your help. I wrote new message to mailing list. I think that my mailing service is also a little buggy :)

I can't understand why it became so complicated? Maybe there are simpler ways?





Воскресенье, 28 июня 2015, 17:43 +02:00 от Tilman Hausherr <TH...@t-online.de>:
>Am 28.06.2015 um 16:02 schrieb Александр Свиридов:
>> How can I print certain page using pdfbox 2.0?
>>
>>
>
>
>
>I don't do printing... I googled a bit and found this solution
>http://www.java2s.com/Code/Java/2D-Graphics-GUI/Printingofamultipagebook.htm
>
>that extends Printable, and limits the page in the print() method.
>
>See also
>http://www.javaworld.com/article/2076250/core-java/printing-in-java--part-2.html
>
>
>Tilman
>
>
>
>(Sorry, now I accidentally sent this to you instead of to the mailing 
>list...aaargh!)
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail:  users-unsubscribe@pdfbox.apache.org
>For additional commands, e-mail:  users-help@pdfbox.apache.org
>


-- 
Alex Sviridov

Re: Re[2]: PDFBox 2.0 how to print certain page

Posted by John Hewson <jo...@jahewson.com>.
> On 28 Jun 2015, at 09:05, Alex Sviridov <oo...@mail.ru> wrote:
> 
> Thank you for your help. I wrote new message to mailing list. I think that my mailing service is also a little buggy :)
> 
> I can't understand why it became so complicated? Maybe there are simpler ways?

It certainly doesn't need to be so complicated, something like this should work:

HashPrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
attributes.add(new PageRanges(1));
printJob.print(new PDFPrinter(), attributes);
-- John

> 
> 
> 
> Воскресенье, 28 июня 2015, 17:43 +02:00 от Tilman Hausherr <TH...@t-online.de>:
>>> Am 28.06.2015 um 16:02 schrieb Александр Свиридов:
>>> How can I print certain page using pdfbox 2.0?
>> 
>> 
>> 
>> I don't do printing... I googled a bit and found this solution
>> http://www.java2s.com/Code/Java/2D-Graphics-GUI/Printingofamultipagebook.htm
>> 
>> that extends Printable, and limits the page in the print() method.
>> 
>> See also
>> http://www.javaworld.com/article/2076250/core-java/printing-in-java--part-2.html
>> 
>> 
>> Tilman
>> 
>> 
>> 
>> (Sorry, now I accidentally sent this to you instead of to the mailing 
>> list...aaargh!)
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:  users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail:  users-help@pdfbox.apache.org
> 
> 
> -- 
> Alex Sviridov