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

Luca Bellonda commented on FOP-3230:
------------------------------------

Hello, in the patch proposed in attachment there is a solution to overcome the 
problem of inserting PDF content in an incorrect position in the structure 
tree, thus respecting the logical reading order.

This is an incomplete solution, but it can handle the common case where the 
image is the only child of a block. A more complete solution is included, but 
it requires changes to the PDFStructElem class.

+Description of the change:+

Since the parent of the image content is marked as 'Div' in 
configureCurrentSessionElem(), we can use the currently empty 'P' that owns the 
image as the new parent (see screenshots).

I prepared a test suite with FO files and resulting PDFs, then tested them 
using PAC.

In the zip you'll find:
 * "errors" folder: PAC screenshots of the errors/non-compliance issues,

 * "output_asis" folder: PDFs generated by the current plugin version,

 * "output_patch" folder: PDFs generated by the proposed patch,

 * all the .fo files and source materials needed to reproduce the issue,

 * the patch (patch_inclusion.patch) for the common case,

 * a more complete patch that requires access to a private field of 
PDFStructElem to compile (complete_patch.patch).

PS: the patches reference a PDF binary file for unit tests.

Best regards

[^apache_FOP-3230.zip]

> PDF Images - PDF/UA template with PDF attachments not PDF/UA
> ------------------------------------------------------------
>
>                 Key: FOP-3230
>                 URL: https://issues.apache.org/jira/browse/FOP-3230
>             Project: FOP
>          Issue Type: Bug
>            Reporter: Joao Goncalves
>            Assignee: Joao Goncalves
>            Priority: Major
>             Fix For: main
>
>         Attachments: 
> 0001-FOP-3230-Skip-paragraph-type-elements-when-merging-s-1.patch, 
> 194061_simple.fo, Arial.ttf, Arialbd.ttf, Arialbi.ttf, Ariali.ttf, 
> apache_FOP-3230.zip, fop.xconf, imgs_and_table.fo, imgs_in_table.fo, 
> includePdf.fo, includePdf.pdf, page1.fo, page1_and_doc.fo, page2.fo, 
> page2_and_doc.fo, simple_table.fo, test.pdf
>
>
> When attaching a PDF that is PDF/UA compliant to a PDF/UA template, the 
> result is a PDF that is not compliant with PDF/UA
>  
> Replication Steps:
> Set accessibility to true, and add PDF/UA profile to the pdf part of the fop 
> config.
> Attach to your fo the path for another PDF that is PDF/UA compliant too.
> The result must be a PDF/UA compliant PDF



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

Reply via email to