You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Maruan Sahyoun (JIRA)" <ji...@apache.org> on 2018/03/20 18:00:00 UTC

[jira] [Updated] (PDFBOX-4159) PDFBox doesn't warn if Special graphics state operators are used in text mode

     [ https://issues.apache.org/jira/browse/PDFBOX-4159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maruan Sahyoun updated PDFBOX-4159:
-----------------------------------
    Issue Type: Improvement  (was: Bug)

> PDFBox doesn't warn if Special graphics state operators are used in text mode
> -----------------------------------------------------------------------------
>
>                 Key: PDFBOX-4159
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4159
>             Project: PDFBox
>          Issue Type: Improvement
>    Affects Versions: 2.0.8
>            Reporter: ulrich gratz
>            Assignee: Maruan Sahyoun
>            Priority: Major
>             Fix For: 2.0.10, 3.0.0 PDFBox
>
>         Attachments: pdfa.pdf, screenshot-1.png, test.pdf
>
>
> When i use a large amount of {{AffineTransformations}} the resulting document will open in Acrobat Reader, but each time a warning is displayed, that there is a defect in the document. The code I use is like: 
> {code:java}
> // BROKEN
> context.useFont(FontFace.FONT_TEXT);
> for (int i = 0; i < 80; i++) {
>     context.contentStream.beginText();
>     context.contentStream.saveGraphicsState();
>     context.contentStream.transform(new Matrix(AffineTransform.getTranslateInstance(0, VIEWPORT_TOP - i * 5)));
>     context.contentStream.showText("XXXXXXXXX");
>     context.contentStream.restoreGraphicsState();
>     context.contentStream.endText();
> }
> // WORKS
> context.useFont(FontFace.FONT_TEXT);
> for (int i = 0; i < 80; i++) {
>     context.contentStream.saveGraphicsState();
>     context.contentStream.beginText();
>     context.contentStream.transform(new Matrix(AffineTransform.getTranslateInstance(0, VIEWPORT_TOP - i * 5)));
>     context.contentStream.showText("XXXXXXXXX");
>     context.contentStream.endText();
>     context.contentStream.restoreGraphicsState();
> }
> {code}
> When i skip the transformations or reduce the amount to e.g. 30, everything is fine. The size of {{ty}} or page breaks do _not_ have an influence on the result, it seems to be the amount of transforms.
> I attached a simple PDF sporting the described effect. *Please note:* The effect only occurs in the standalone Acrobat Reader, not the acrobat browser plugin. So to see the error, download the PDF from this ticket and open it independently from the browser.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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