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

Teon Metselaar edited comment on PDFBOX-3046 at 11/4/15 9:20 AM:
-----------------------------------------------------------------

{code}
Exception in thread "main" java.lang.NegativeArraySizeException
        at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:76)
        at java.awt.image.Raster.createInterleavedRaster(Raster.java:266)
        at java.awt.image.BufferedImage.<init>(BufferedImage.java:376)
        at sun.awt.windows.WPathGraphics.redrawRegion(WPathGraphics.java:1354)
        at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:2151)
        at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1488)
        at sun.print.Win32PrintJob.printableJob(Win32PrintJob.java:546)
        at sun.print.Win32PrintJob.print(Win32PrintJob.java:405)
        at PDFBoxTest.main(PDFBoxTest.java:30)

This happens in the following code:
{code}
        public static void main(String[] args) throws Exception {
                PDDocument document = PDDocument.load(new 
File("C:\\appguard\\printjobs\\test.pdf"));
                
                PDFPrintable printable = new PDFPrintable(document);
                
                for(PrintService printService : 
PrintServiceLookup.lookupPrintServices(null, null)) {
                        if(printService.getName().equals("HP Color LaserJet 
4700 PS Class Driver")) {
                                DocPrintJob job = printService.createPrintJob();
                                
                                PrintRequestAttributeSet attr = new 
HashPrintRequestAttributeSet();
                                attr.add(new Destination(new 
URI("file:////c:/appguard/printjobs/pdfbox.out")));
                                Doc doc = new SimpleDoc(printable, 
DocFlavor.SERVICE_FORMATTED.PRINTABLE, null);
                                job.print(doc, attr);
                        }
                }
        }
{/code}


was (Author: teon):
{code}
Exception in thread "main" java.lang.NegativeArraySizeException
        at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:76)
        at java.awt.image.Raster.createInterleavedRaster(Raster.java:266)
        at java.awt.image.BufferedImage.<init>(BufferedImage.java:376)
        at sun.awt.windows.WPathGraphics.redrawRegion(WPathGraphics.java:1354)
        at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:2151)
        at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1488)
        at sun.print.Win32PrintJob.printableJob(Win32PrintJob.java:546)
        at sun.print.Win32PrintJob.print(Win32PrintJob.java:405)
        at PDFBoxTest.main(PDFBoxTest.java:30)
{/code}

This happens in the following code:
{code}
        public static void main(String[] args) throws Exception {
                PDDocument document = PDDocument.load(new 
File("C:\\appguard\\printjobs\\test.pdf"));
                
                PDFPrintable printable = new PDFPrintable(document);
                
                for(PrintService printService : 
PrintServiceLookup.lookupPrintServices(null, null)) {
                        if(printService.getName().equals("HP Color LaserJet 
4700 PS Class Driver")) {
                                DocPrintJob job = printService.createPrintJob();
                                
                                PrintRequestAttributeSet attr = new 
HashPrintRequestAttributeSet();
                                attr.add(new Destination(new 
URI("file:////c:/appguard/printjobs/pdfbox.out")));
                                Doc doc = new SimpleDoc(printable, 
DocFlavor.SERVICE_FORMATTED.PRINTABLE, null);
                                job.print(doc, attr);
                        }
                }
        }
{/code}

> Specific PDF prints really (REALLY) slow
> ----------------------------------------
>
>                 Key: PDFBOX-3046
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3046
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>         Environment: Windows 10
>            Reporter: Teon Metselaar
>         Attachments: mspubcol.pdf, mspubcol.prn
>
>
> On Windows 10 I have printed a test page using the MS Publisher Color Printer 
> (which outputs a Postscript-file) and converted that file to PDF using 
> GhostScript ps2pdf.
> The resulting single-page PDF file is printed really, really slow (180-190 
> seconds) while other documents (even generated using ps2pdf) print a lot 
> faster (some seconds).
> I can't figure out why this is. I guess it has someting to do with the used 
> font, but other PDF printing libraries (jPedal, jPDFPrint) are able print the 
> same documents in a couple of seconds.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to