pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Bad file orientation in printer
Date Fri, 08 Jul 2016 19:19:01 GMT
Your file didn't go through, although I have it (as moderator).

I tried printing on an ordinary printer and it was always 90° rotated, 
even with two other java products.

What worked is this code:

                 PrinterJob job = PrinterJob.getPrinterJob();
                 job.setPageable(new PDFPageable(document, 
Orientation.PORTRAIT, false, 0));
                 if (job.printDialog())
                 {
                     job.print();
                 }

Don't know if this works with your printer. I remember having heard such 
problems before.

You could also try replacing the 0 with 200 or 300.

Tilman

Am 08.07.2016 um 20:56 schrieb Frank Malenfant:
>
> Hi,
>
>     As I have done many times before without any problem, I am trying 
> to use the PrintPDF command line tool to send a PDF (see attached 
> file) to a printer which is a Zebra ZT230. It is a label, so I 
> generated a media sized PDF file using PHP’s ezPDF like I do since 10 
> years, configured the default settings for the Zebra printer in 
> Windows Server 2012 (see screenshot below) and used pdfBox v2.0.2 
> (also tried v1.8.10). The label is 4 inches wide x 2 inches long, but 
> it prints like it’s rotated 90° counter-clock-wise and on the right. 
> Here is what I’ve tried so far before I reached your community.
>
> 1.I printed the PDF directly through Acrobat, it printed Well.
>
> 2.I tried to generate a label that is rotated to match the behaviour 
> of the printer (rotating the PDF file by 90°), it acted as if I 
> rotated it by 180°, it’s still not displaying the content with the 
> good orientation on the media.
>
> 3.I changed the definition of my PDF file from 2 x 4 (with portrait 
> orientation) to 4 x 2 (with landscape orientation), same result as #2
>
> 4.Modified the default printer settings from “Portrait” to 
> “Landscape”, no difference at all
>
> 5.Changed the media size in the default printer settings from 4 x 2 to 
> 2 x 4, no difference at all
>
>   So, I’m pretty sure I’ve ruled out my PDF generator from the 
> equation (+ I’ve been using it to generate labels like these for years 
> on Windows Server 2008 and CentOs 7 servers), I also know from 
> printing through Acrobat that the printer behaves well and that the 
> printer settings are OK. I really don’t know why pdfBox could be 
> working differently on this machine but it looks like the only likely 
> option left.
>
> Is there anyway I could force some settings or orientation through 
> pdfBox using the Command line tools or do you have any ideas for a fix 
> I could try?
>
> Please help me, I’ve struggling with this for hours and I’m getting 
> pretty frustrated although I made sure to rule out as much 
> possibilities as I could think before I contact you.
>
> Many thanks,
>
> */      Sorry it’s in French, I translated some words to help you 
> understand/*
>
> Frank Malenfant
>
> *Analyste / Responsable T.I.*
>
> *Verbois*
>
> 140, L.P. Lebrun
>
> Rivière-du-Loup, QC  G5R 5W8
>
> T: 418.868.0500  #222 -  F: 418.868.0055
>
> S.F. : 1.888.775.0500__
>
> */__/*
>
> Instagram_24 <http://instagram.com/verbois.admin?ref=badge>.facebook 
> <http://www.facebook.com/creationsverbois>pinterest 
> <http://fr.pinterest.com/jrverbois/>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org



Mime
View raw message