make kitchen-sink-accessible example fully PDF/UA compliant#1707
Open
andreiaugustin wants to merge 3 commits intofoliojs:masterfrom
Open
make kitchen-sink-accessible example fully PDF/UA compliant#1707andreiaugustin wants to merge 3 commits intofoliojs:masterfrom
andreiaugustin wants to merge 3 commits intofoliojs:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix
What kind of change does this PR introduce?
This PR makes the kitchen-sink-accessible example fully PDF/UA compliant, fixing #1633.
There were a few issues:
CS operator violation (ISO 32000-2 Fig. 9) - essentially color space operators aren't permitted during path construction, so any
fillColororstrokeColormust happen beforehand. I looked into the possibility of caching things so at the end we can write them to the PDF in the right order, but it's not as straightforward as I would've hoped and I think keeping things simple without changing too much might be best, at least for now.Perhaps we should document this, if it is not already.Edit: added to docs within this PR.The figure structure element required a bounding box, so a
bboxoption was added toPDFStructureElementwhich writes out aBBoxentry into the 'Layout' attribute. Also, PAC was still throwing errors about improper use because we were missing thePlacementattribute which is now added and defaulted toBlock, but can be overridden with theplacementoption.The
Linkneeded to be contained within a block-level element, so I've wrapped it in aPin the example. ISO 32000-2 Annex A says it's an inline-level element so needs to be wrapped into aPorH1for example when inside a grouping element likeSect.Now, there's another issue which is not directly fixed here, but I think it cropped up in other issues already: the built-in fonts, being AFM-only, they don't embed and that is required in order to be compliant with PDF/A or PDF/UA, so using the built-in fonts will result in a non-compliant PDF output. Short of growing the size of the library with full ttf built-in fonts which can be embedded.
, I reckon we should just document this as a limitation/requirements if anybody wants to produce compliant PDF/A / PDF/UA?Edit: added to docs within this PR.Checklist: