Skip to content
Discussion options

You must be logged in to vote

Just as I suspected! I have good news for you:

The base library has a solution for this, which is immediately available in PyMuPDF. There is a function that "bakes" annotations and fields (!!!) into the PDF - which means it converts these items into normal page content.
You have to bake the source PDF before using it in .show_pdf_page(). After baking, no annotations and no fields will exist anymore - but otherwise, every page will look exactly equal.

This is how it works:

src = fitz.open("source.pdf")  # this actually is a "fz_document" with an underlying PDF document
src_pdf = fitz.mupdf.pdf_document_from_fz_document(doc)  # access underlying PDF
fitz.mupdf.pdf_bake_document(src_pdf, 1, 1)…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@JorjMcKie
Comment options

Answer selected by izerui
@izerui
Comment options

@izerui
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants