Skip to content

How to check if pdf is PDF/A or not? And is there a way to convert PDF->PDF/A and vice versa? #2169

Answered by JorjMcKie
PasaOpasen asked this question in Q&A
Discussion options

You must be logged in to vote

As I see, mostly PDF/A is PDF + fonts. Is there a way to detect PDF/A and to convert from/to PDF/A?

Well, that's a simplified characterization.
Anyway, PyMuPDF does not support PDF/A on output and saves in standard format. Cannot convert to PDF/A - and there is no intention to do so in the foreseeable future.

To determine if an input file is in some of those formats (yes: plural!), check the catalog. It will contain an "output intent dictionary", see page 641 / "Table 365" ("Document management - Portable document format - Part 1: PDF 1.7") for a description. To access it, get the catalog xref = doc.pdf_catalog() and then inspect doc.xref_get_key(xref, "OutputIntents"). This should be a…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@PasaOpasen
Comment options

@JorjMcKie
Comment options

@PasaOpasen
Comment options

@JorjMcKie
Comment options

Answer selected by PasaOpasen
Comment options

You must be logged in to vote
1 reply
@JorjMcKie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants