pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Sviridov <ooo_satu...@mail.ru>
Subject Re[2]: PdfBox 2.0 scale to A4 while printing document
Date Sun, 28 Jun 2015 16:01:27 GMT
 The file I tested is here  https://yadi.sk/i/iX-KJwlhhXMY2

I printed this pdf file with Adobe Reader in mode 100%. And as expected left and right margins
are about 2cm. In comparison when I print using pdfbox left margin is 4.5cm, right about 3.5cm.

The code I use :
PrinterJob job = PrinterJob.getPrinterJob();
Paper paper=new Paper();
paper.setSize(72d*8.267d, 72d*11.692);
PDFPrinter pDFPrinter=new PDFPrinter(document,Scaling.SCALE_TO_FIT, Orientation.PORTRAIT,paper);
pDFPrinter.silentPrint(job);

Questions:
1) how can I make pdfbox to SCALE_TO_FIT?
2) how can I print only certain page - not entire document?












Воскресенье, 28 июня 2015, 17:40 +02:00 от Tilman Hausherr <THausherr@t-online.de>:
>Hi,
>
>Something is indeed a bit tricky with your mailing software, your own 
>comments are mixed with my comments. But I think I got them. Sorry for 
>my "What else would you expect" comment, that was a failed attempt of 
>being funny.
>
>I don't have LibreOffice installed, I don't know if the others do. So 
>the best would be that you create a PDF where the borders are obvious, 
>and upload it somewhere.
>
>Tilman
>
>
>
>Am 28.06.2015 um 17:33 schrieb Александр Свиридов:
>> Воскресенье, 28 июня 2015, 17:10 +02:00 от Tilman Hausherr <
THausherr@t-online.de >:
>>> Am 28.06.2015 um 16:43 schrieb Александр Свиридов:
>>>>    When I print pdf document it doesn't stretch to take normal A4 page area.
I mean that margins are too big and document is smaller then it could be and is located in
center of the page.
>>> Yes it is centered. What else would you expect? Adjusted to the bottom
>>> right? I don't understand you. Really. Of course I expect it to be centered.
And it is centered as it's expected. However, If everything were as expected I wouldn't right
to mailing list, would I?
>> I always thought that information for fixing some bug is a starting point. That's
why I provided this information.
>>> We'd need the PDF to find out what (if anything) is wrong I do all files using
Libre Office. I tried different files and even very simple ones. So just take any file and
you must get the same results.
>>>
>>>
>>> Please try also printing it with Adobe Reader in 100% mode. I printed my pdf
file with Adobe Reader in mode 100%. And as expected left and right margins are about 2cm.
In comparison when I print using pdfbox left margin is 4.5cm, right about 3.5cm.
>>>
>>> Tilman
>>>
>>> PS: don't CC user postings to me. I get then anyway. Really sorry for this. I
can't understand why my mailing service added your address and I didn't notice it.
>> So the problem is still there. How to fix it?
>>>> My code:
>>>> PrinterJob job = PrinterJob.getPrinterJob();
>>>> Paper paper=new Paper();
>>>> paper.setSize(72d*8.267d, 72d*11.692);
>>>> PDFPrinter pDFPrinter=new PDFPrinter(document,Scaling.SCALE_TO_FIT, Orientation.PORTRAIT,paper);
>>>> pDFPrinter.silentPrint(job);
>>>>
>>>> Please help me to solve this problem.
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:  users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail:  users-help@pdfbox.apache.org
>>>
>
>
>---------------------------------------------------------------------
>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, None, 0 bytes)
View raw message