[ 
https://issues.apache.org/jira/browse/PDFBOX-4740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17016682#comment-17016682
 ] 

Christian Appl edited comment on PDFBOX-4740 at 1/16/20 8:50 AM:
-----------------------------------------------------------------

I am currently using Open JDK 11.0.2 on a Windows 10 OS.

The issue can not be reproduced on all printers - the printouts for Microsoft 
print to PDF are all fine and do not show this behaviour also some physical 
printers such as our "Brother MFC-L8900CDW" can not reproduce the issue.
 Some printers however do. We are not really 100% certain which may be the 
problem here and what may be the common charateristic of said printers.
 However we would assume that the PDF document itself is fine and should 
(theoretically) print fine on any printer. What I am presenting here is the 
minimal setup I was able to reproduce the issue with.
 - The shared Java code has been reduced to the minimum ammount of instructions 
required to reproduce the issue.
 - The document has been created from scratch to rule out that the document 
itself is problematic. (As the problem originally occurred using another 
document.)

**What we did, to reproduce those issues on printers, that we don't own:**
 We installed the drivers for said printers, put them on hold (as seen in 
holdPrinter.png). This will create spool files, but will not send them to the 
physical printer. (C:\Windows\System32\spool\PRINTERS)
 The spool file can then be inspected using the Microsoft "XPS-Viewer" (The 
application should be preinstalled on your OS and can be used to inspect XPS 
based spool files) or the O&K Printer Viewer (For non XPS formats - this 
application unfortunately is not available for free - edit: however a 30 day 
trial version is)

**Answering the obvious assumption:**
 Yes, we could also reproduce the issue on physical printouts, it is not just 
an issue of the applications we use to inspect the spool files.

**Our observations:**
 The issue is seemingly occuring for non XPS-based printer drivers only. We do 
assume, that the behaviour is occuring on PCL based printers, but that is a 
mere assumption. However - we were not able to reproduce the issue on XPS based 
printers up to now.

**Results for the Kyoceira FS-4100DN**
 For example inspecting the spool file of the Kyoceira FS-4100DN one can find 
the following result.

!image-2020-01-16-09-13-50-730.png!


was (Author: capsvd):
I am currently using Open JDK 11.0.2 on a Windows 10 OS.

The issue can not be reproduced on all printers - the printouts for Microsoft 
print to PDF are all fine and do not show this behaviour also some physical 
printers such as our "Brother MFC-L8900CDW" can not reproduce the issue.
 Some printers however do. We are not really 100% certain which may be the 
problem here and what may be the common charateristic of said printers.
 However we would assume that the PDF document itself is fine and should 
(theoretically) print fine on any printer. What I am presenting here is the 
minimal setup I was able to reproduce the issue with.
 - The shared Java code has been reduced to the minimum ammount of instructions 
required to reproduce the issue.
 - The document has been created from scratch to rule out that the document 
itself is problematic. (As the problem originally occurred using another 
document.)

**What we did, to reproduce those issues on printers, that we don't own:**
 We installed the drivers for said printers, put them on hold (as seen in 
holdPrinter.png). This will create spool files, but will not send them to the 
physical printer. (C:\Windows\System32\spool\PRINTERS)
 The spool file can then be inspected using the Microsoft "XPS-Viewer" (The 
application should be preinstalled on your OS and can be used to inspect XPS 
based spool files) or the O&K Printer Viewer (For non XPS formats - this 
application unfortunately is not available for free)

**Answering the obvious assumption:**
 Yes, we could also reproduce the issue on physical printouts, it is not just 
an issue of the applications we use to inspect the spool files.

**Our observations:**
 The issue is seemingly occuring for non XPS-based printer drivers only. We do 
assume, that the behaviour is occuring on PCL based printers, but that is a 
mere assumption. However - we were not able to reproduce the issue on XPS based 
printers up to now.

**Results for the Kyoceira FS-4100DN**
 For example inspecting the spool file of the Kyoceira FS-4100DN one can find 
the following result.

!image-2020-01-16-09-13-50-730.png!

> PDFPrintable is creating incomplete/odd output for some printers
> ----------------------------------------------------------------
>
>                 Key: PDFBOX-4740
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4740
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.15, 2.0.18
>            Reporter: Christian Appl
>            Priority: Major
>              Labels: PDFBox, printer
>         Attachments: holdPrinter.png, image-2020-01-15-15-01-32-976.png, 
> image-2020-01-16-09-13-50-730.png, out.pdf
>
>
> We are printing PDF documents using the class "PDFPrintable", which is 
> working fine for most documents and printers.
> Except we found a case where the bounding box of an image is seemingly 
> clipping the contents of a following page in the printouts of certain 
> documents:
> !image-2020-01-15-15-01-32-976.png!
> (The whole cropbox of the second page should have been painted red - compare 
> attached document)
> The following code can be used to reproduce the issue:
> {code:java}
> private static void print(PDDocument document, String printerName) throws 
> PrinterException {
>     PrinterJob printerJob = PrinterJob.getPrinterJob();
>     PrintService printService = null;
>     // loop through all printers
>     for (PrintService deviceInterface : PrinterJob.lookupPrintServices()) {
>         // get printer name
>         String name = deviceInterface.getName();
>         // is this the requested printer?
>         if (name != null && name.equals(printerName)) {
>             // configure print job for the printer
>             printService = deviceInterface;
>             break;
>         }
>     }
>     if (printService == null) {
>         return;
>     }
>     printerJob.setPrintService(printService);
>     // set source and execute print job.
>     printerJob.setPrintable(
>         new PDFPrintable(
>             document, null, false, 0, true
>         )
>     );
>     // init print attribute set.
>     PrintRequestAttributeSet printAttrSet = new 
> HashPrintRequestAttributeSet();
>     printAttrSet.add(new JobName(printerName + "_job", Locale.ENGLISH));
>     printAttrSet.add(PrintQuality.HIGH);
>     // do print.
>     printerJob.print(printAttrSet);
> }
> {code}
> The attached document is leading to the erroneous results, when printed via 
> the given method. (and using the following printers)
> Some printers, which show this odd behaviour are:
>  - "Adobe PDF" printer (most likely the easiest way to reproduce this issue)
>  - Konica Minolta C658
>  - Kyocera FS-4100DN
> We are suspecting, an compatibility issue of PCL based printer drivers and 
> some instructions created by PDFBox.
> This behaviour can only then be seen for the following page, if it does 
> contain certain operations. (Such as Shaders => as demonstrated in the 
> example document)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to