Bug 50986 - [PATCH] Acessibility: Invalid PDF page content
Summary: [PATCH] Acessibility: Invalid PDF page content
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: trunk
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-28 11:38 UTC by Martin K
Modified: 2012-04-01 06:19 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin K 2011-03-28 11:38:43 UTC
FOP uses an incorrect order of ET/EMC operands in some cases:
BCD
BT
[...]
EMC
ET
Correct would be:
BCD
BT
[...]
ET
EMC
[The last open element must be closed first]

diff --git a/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java b/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java
--- a/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java
+++ b/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java
@@ -270,10 +270,10 @@ public class PDFContentGenerator {
     /** Indicates the end of a text object. */
     protected void endTextObject() {
         if (textutil.isInTextObject()) {
+            textutil.endTextObject();
             if (this.inMarkedContentSequence) {
                 endMarkedContentSequence();
             }
-            textutil.endTextObject();
         }
     }
Comment 1 Andreas L. Delmelle 2011-04-03 05:57:53 UTC
Fixed in r1088231. See: http://svn.apache.org/viewvc?rev=1088231&view=rev

Thanks for the patch! (and sorry for the mixed up credits... I was also working on bug 50988. I will see if I can correct that; already done in status.xml, so will be correctly reflected on the website.)
Comment 2 Glenn Adams 2012-04-01 06:19:21 UTC
batch transition to closed; if someone wishes to restore one of these to resolved in order to perform a verification step, then feel free to do so