[
https://issues.apache.org/jira/browse/PDFBOX-5601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17722322#comment-17722322
]
Tilman Hausherr commented on PDFBOX-5601:
-----------------------------------------
Update: it's not related to the flipcart image, I was able to reproduce the
effect with only the rotated barcode. With this, I was able to create a non
PDFBox code:
{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
{
BufferedImage bim = ImageIO.read(new
URL("https://issues.apache.org/jira/secure/attachment/13058029/PDFBOX-5601-original-barcode.png").openStream());
g2d.drawImage(bim, AffineTransform.getScaleInstance(2, 2),
null);
g2d.transform(new AffineTransform(1, 0, 0, -1, 0, 100));
g2d.scale(0.01, 0.001);
AffineTransform at = new
AffineTransform(0,-1410,277.5,0,221.25,3036.25);
g2d.drawImage(bim, at, null);
}
catch (IOException ex)
{
ex.printStackTrace();
System.exit(-1);
}
return Printable.PAGE_EXISTS;
}
return Printable.NO_SUCH_PAGE;
}
}
{code}
Please try this code on a windows and a non windows system to see if there are
any differences.
> 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
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]