Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate accessible PDFs with FOP #64

Closed
shaneataylor opened this issue Feb 4, 2016 · 10 comments
Closed

Can't generate accessible PDFs with FOP #64

shaneataylor opened this issue Feb 4, 2016 · 10 comments
Labels
wontfix This will not be worked on
Milestone

Comments

@shaneataylor
Copy link
Contributor

See #63

When you turn on the accessibility flag in FOP, PDF generation fails. This might be an FOP problem or a problem with the FO the toolkit is generating (I'm not sure yet, but I think it's FOP) but it's reasonable for OT users to want to use this flag and worth documenting that at present it won't work.

I've tested with FOP versions 1.1. and 2.1 with DITA-OT 2.2 and a PDF plugin that makes only minor modifications (its FO generates fine without the accessibility flag). Have not yet tested with other versions of DITA-OT or a purely stock OT build.

@shaneataylor
Copy link
Contributor Author

Would be interested in others' experience enabling accessibility with AH or XEP.

@infotexture
Copy link
Member

@jelovirt, @raducoravu: Are you aware of this? Any insight as to whether this is an OT or FOP issue?

@robander
Copy link
Member

robander commented Feb 4, 2016

I had not tried it. I know accessibility in PDF is difficult, and wouldn't be surprised if there's an FOP issue, but can't say where the issue is. If it's an OT issue, and something we can fix given the complexity of the PDF2 design, then I'd treat it as pretty high priority.

@raducoravu
Copy link
Member

Running a small sample DITA Map with Apache FOP 2.1 and accessibility enabled in the fop.xconf works for me, it complains about a couple of missing alternate text descriptions but the transformation ends succesfully:

  [fop] 1095 WARN [ main ] org.apache.fop.apps.FOUserAgent - Alternate text is missing on external-graphic. (See position 170:-1)
  [fop] 1109 WARN [ main ] org.apache.fop.apps.FOUserAgent - Alternate text is missing on external-graphic. (See position 217:-1)

@raducoravu
Copy link
Member

Tested also with FOP 1.1 (bundled with DITA OT) and publishing my sample with accessibility enabled still works for me. So having a sample DITA project for reproducing the issue posted would help.

@shaneataylor
Copy link
Contributor Author

@raducoravu I uploaded a project to Dropbox: https://www.dropbox.com/s/eyc9t6fcgpeo1a1/fop_accessibility_test.tgz?dl=0

The build_both.sh builds the exact same content (edit it to point to your OT) with a default fop.xconf file and with one that has the accessibility flag enabled. The latter fails.

Although there are quite a number of source files — such is the nature of interdependency when using common symbols files for a longstanding DITA project — those rendered in the output are relatively few, and the .fo is not unreasonably large to examine.

I'll be happy to open an issue in the dita-ot project once we have a better idea why it's failing and believe it's actually an issue with dita-ot and not FOP. Thanks for looking into this!

@raducoravu
Copy link
Member

I reproduced the issue using your samples and Apache FOP:

  [fop] Caused by: java.lang.NullPointerException
  [fop]     at org.apache.fop.accessibility.fo.StructureTreeEventTrigger.addRole(StructureTreeEventTrigger.java:400)
  [fop]     at org.apache.fop.accessibility.fo.StructureTreeEventTrigger.startElement(StructureTreeEventTrigger.java:383)
  [fop]     at org.apache.fop.accessibility.fo.StructureTreeEventTrigger.startElement(StructureTreeEventTrigger.java:357)
  [fop]     at org.apache.fop.accessibility.fo.StructureTreeEventTrigger.startInline(StructureTreeEventTrigger.java:163)
  [fop]     at org.apache.fop.accessibility.fo.FO2StructureTreeConverter.startInline(FO2StructureTreeConverter.java:206)

Not sure which part of the DITA content triggers this though. Looks like an Apache FOP bug.
For me it seemed to work using Apache FOP 2.1 to produce the PDF. So you could try that as a workaround.

@shaneataylor
Copy link
Contributor Author

Using FOP 2.1 addresses the scope of the problem described by this ticket (allows PDFs to be built successfully with the accessibility flag enabled). I believe this ticket can be closed.

Note that this ticket is not intended to address other issues related to PDF compliance with WCAG or other accessibility standards.

@infotexture infotexture added the wontfix This will not be worked on label Oct 6, 2016
@infotexture infotexture added this to the 2.4 milestone Oct 6, 2016
@infotexture
Copy link
Member

If upgrading to FOP 2.1 fixes this, let's close it when dita-ot/dita-ot#2399 is merged.

@infotexture
Copy link
Member

Resolved by upgrading to FOP 2.1 per dita-ot/dita-ot#2399.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants