pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hewson <j...@jahewson.com>
Subject Re: Re[2]: PDFBox 2.0 how to print certain page
Date Sun, 28 Jun 2015 17:06:23 GMT

> On 28 Jun 2015, at 09:05, Alex Sviridov <ooo_saturn7@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 <THausherr@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

Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message