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

Cherry-pick from PR #143: pdf/a support #250

Merged
merged 1 commit into from
Jul 14, 2018
Merged

Cherry-pick from PR #143: pdf/a support #250

merged 1 commit into from
Jul 14, 2018

Conversation

syjer
Copy link
Contributor

@syjer syjer commented Jul 13, 2018

Hi @danfickle , I've cherry-picked from the PR done by @backslash47 the pdf/a support.

Additionally, from the PR, I've done some changes:

  • refactored the code: the 2 new parameters are set in the State object
  • switched from string to enum for setting the pdf/a level as requested in the comment of the PR
  • added the "StructTreeRoot" for passing the pdf/a-1 validation.

I've validated the various level of compliance using https://www.pdf-online.com/osa/validate.aspx and they seems to pass. Obviously you need to supply a ICC profile (I've used the one from https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/resources/org/apache/pdfbox/resources/pdfa/ )

As an interesting note: for level 1/2 validation, you cannot use the fallback fonts: all the fonts must be embedded.

+ refactoring: use enum for setting the conformance level
+ add missing StructTreeRoot for enabling pdf/a-1 compliance

add missing StructTreeRoot for enabling pdf/a-1 compliance
@danfickle
Copy link
Owner

Awesome. Thanks @syjer

The only change I will make after the merge is to add NONE to the enum in place of using null to signify the same.

Also I will change the font resolver to not add the built-in fonts when PDF/A conformance is required as part of #249

Thanks again.

@danfickle danfickle merged commit 02c2a66 into danfickle:open-dev-v1 Jul 14, 2018
danfickle added a commit that referenced this pull request Jul 14, 2018
…uired.

FIXME: Causes a crash if no fonts are available for any text.
@syjer
Copy link
Contributor Author

syjer commented Jul 14, 2018

@danfickle thank you.

By the way, if you choose the conformance level PDF/A-3, it's not required to embed the fonts, so the condition should be (NONE || PDF_A_3) :)

@danfickle
Copy link
Owner

@syjer
I couldn’t find any info regarding a font embedding exception for pdf/a-3. Do you have a source? Thanks.

@syjer
Copy link
Contributor Author

syjer commented Jul 20, 2018

@danfickle , I derived empirically using the pdf/a validator ( https://www.pdf-online.com/osa/validate.aspx ), but you are right that in the specifications, there is no exception. So most likely I'm wrong :)

@syjer syjer deleted the pdf-a-support branch August 15, 2018 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants