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

Tilman Hausherr commented on PDFBOX-5601:
-----------------------------------------

Would you agree that the output in  [^reproduced.pdf] reproduces the effect 
(although not the same as yours)? There are three widths now. IIRC 1D barcodes 
have 2 widths.
{code}
public class PDFBox5601BadPrint implements Printable
{
    public static void main(String[] args) throws PrinterException
    {
        new PDFBox5601BadPrint().doStuff();
    }

    PDFBox5601BadPrint()
    {
    }

    void doStuff() throws PrinterException
    {
        PrinterJob job = PrinterJob.getPrinterJob();
        job.setPrintService(PrintServiceLookup.lookupDefaultPrintService());
        job.setPrintable(this);
        if (job.printDialog())
        {
            job.print();
        }
    }

    @Override
    public int print(Graphics graphics, PageFormat pageFormat, int index)
    {
        if (index == 0)
        {
            Graphics2D g2d = (Graphics2D) graphics;
            try
            {
                AffineTransform at = 
AffineTransform.getRotateInstance(Math.toRadians(90));
                at.translate(150, -200);
                at.scale(1.5f, 1);
                BufferedImage bim = ImageIO.read(new 
URL("https://issues.apache.org/jira/secure/attachment/13058029/PDFBOX-5601-original-barcode.png";).openStream());
                g2d.drawImage(bim, at, null);            
            }
            catch (IOException ex)
            {
                ex.printStackTrace();
                System.exit(-1);
            }
            return Printable.PAGE_EXISTS;
        }
        return Printable.NO_SUCH_PAGE;
    }
}
{code}


> Barcode corrupted when printing document
> ----------------------------------------
>
>                 Key: PDFBOX-5601
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5601
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.27
>            Reporter: Tres Finocchiaro
>            Priority: Major
>         Attachments: 234457694-edit.pdf, PDFBOX-5601-original-barcode.png, 
> jpeg.jpg, preview.png, reproduced.pdf
>
>
> When printing the attached document, the barcode on the left side is 
> corrupted.  Please see preview of desired versus actual.
>  !preview.png! 
> * This does not occur when printing with other applications
> * This issue also occurs on the latest 3.0 alpha version
> {code:java}
> java -jar pdfbox-app-2.0.27.jar PrintPDF 234457694-edit.pdf
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to