pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkuehler <andr...@lehmi.de>
Subject Re: I need help!!!! about Landscape Page Format printing
Date Sun, 06 Oct 2013 13:42:21 GMT
Hi,

Am 06.10.2013 00:44, schrieb cenk dundar:
> Hi Andreas,
>
> Have you find any solution about to print
> landscape format pdf page
>
> I sent the test pdf to you
>
> Thank you for your help
I can't reproduce your issue. It works fine for me using PrintPDF

BR
Andreas Lehmkühler
>
> --------------------------------------------------------------------------------
> *From:* Andreas Lehmkühler <andreas@lehmi.de>
> *To:* cenk dundar <cenkdundar@yahoo.com>
> *Sent:* Thursday, September 26, 2013 1:05 PM
> *Subject:* Re: I need help!!!! about Landscape Page Format printing
>
> Hi,
>
>
>  > cenk dundar <cenkdundar@yahoo.com
> <mailto:cenkdundar@yahoo.com>> hat am 23. September 2013 um 09:15 geschrieben:
>  >
>  >
>  > There is a pdf file that included some of page is Landscape format. When I print
this document landscape pages cannot be printed correctly. It is printed as portrait format.
>  >
> Can you provide us with a sample pdf?
>
>  > I see that this problem fixed with Ver 1.8.0. I am trying with last version. But
The result is same.
>  >
>  > My test source code is below
>  >
>  > public static void main(String[] args) throws Exception {
>  >         String password = "";
>  >         String pdfFile = "D:/TestPdf.pdf";
>  >         boolean silentPrint = true;
>  >         String printerName = "HP";
>  >         /*for (int i = 0; i < args.length; i++) {
>  >             if (args[i].equals(PASSWORD)) {
>  >                 i++;
>  >                 if (i >= args.length) {
>  >                     usage();
>  >                 }
>  >                 password = args[i];
>  >             } else if (args[i].equals(PRINTER_NAME)) {
>  >                 i++;
>  >                 if (i >= args.length) {
>  >                     usage();
>  >                 }
>  >                 printerName = args[i];
>  >             } else if (args[i].equals(SILENT)) {
>  >                 silentPrint = true;
>  >             } else {
>  >                 pdfFile = args[i];
>  >             }
>  >         }*/
>  >
>  >         if (pdfFile == null) {
>  >             usage();
>  >         }
>  >
>  >         PDDocument document = null;
>  >         try {
>  >             document = PDDocument.load(pdfFile);
>  >
>  >             if (document.isEncrypted()) {
>  >                 document.decrypt(password);
>  >             }
>  >             PrinterJob printJob = PrinterJob.getPrinterJob();
>  >
>  >             if (printerName != null) {
>  >                 PrintService[] printService = PrinterJob.lookupPrintServices();
>  >                 boolean printerFound = false;
>  >                 for (int i = 0; !printerFound && i < printService.length;
i++) {
>  >                     if (printService[i].getName().indexOf(printerName) != -1) {
>  >                         printJob.setPrintService(printService[i]);
>  >                         printerFound = true;
>  >                     }
>  >                 }
>  >             }
>  >
>  >             if (silentPrint) {
>  >                 document.silentPrint(printJob);
>  >             } else {
>  >                 document.print(printJob);
>  >             }
>  >         } finally {
>  >             if (document != null) {
>  >                 document.close();
>  >             }
>  >         }
>  >     }
>  >
>  >
>  >
>  > Thank you for your help!
>  >
>  >
>  >
>  > ________________________________
>  >  From: Andreas Lehmkuehler <andreas@lehmi.de <mailto:andreas@lehmi.de>>
>  > To: users@pdfbox.apache.org <mailto:users@pdfbox.apache.org>
>  > Sent: Sunday, September 22, 2013 10:00 PM
>  > Subject: Re: I need help!!!! about Landscape Page Format printing
>  >
>  >
>  > Hi,
>  >
>  > Am 22.09.2013 16:46, schrieb cenk dundar:
>  > >
>  > >
>  > > Hi,
>  > >
>  > > I am sending second time, I havent any solution about this subject. I wish
you may help me!
>  > Maybe you should give us more input first:
>  >
>  > What exactly did you do?
>  > What did you get?
>  > How about a sample pdf?
>  >
>  > > My problem is that;
>  > > I see Fixed problem that to print landscape page in 1.8.0 version. But I am
trying with new version the problem is same. Is there any example to print landscape pdf page
correctly.
>  >
>  >
>  > BR
>  > Andreas Lehmkühler
>
>
> BR
> Andreas Lehmkühler
>
>


Mime
View raw message