PyMuPDF icon indicating copy to clipboard operation
PyMuPDF copied to clipboard

Another issue with destroying PDF when inserting html

Open elizarrrrr opened this issue 2 years ago • 6 comments

We have another issue:

We use it with page.clean_contents(true), as you know making it false causes the issue above. The result is that the whole PDF content is deleted.

White_pdf_IN.pdf White_pdf_OUT.pdf

Originally posted by @elipongr in https://github.com/pymupdf/PyMuPDF/issues/3741#issuecomment-2373626282

elizarrrrr avatar Sep 25 '24 10:09 elizarrrrr

There is need to used page.clean_contents() any longer to ensure correct positions of content insertions.

JorjMcKie avatar Sep 25 '24 15:09 JorjMcKie

Any blog or documentation where you have updated it?

elizarrrrr avatar Sep 25 '24 16:09 elizarrrrr

Any blog or documentation where you have updated it?

We have made this more explicit in the current documentation https://pymupdf.readthedocs.io/en/latest/functions.html#Page.clean_contents.

JorjMcKie avatar Oct 22 '24 21:10 JorjMcKie

Otherwise, this is now a duplicate of #4034, for which an upstream bug has been submitted.

JorjMcKie avatar Nov 11 '24 13:11 JorjMcKie

Issue #4034 has been closed, but perhaps this issue needs to be manually closed? I don't know how github duplicate issues work in relation to resolution. :)

sebras avatar Jan 24 '25 15:01 sebras

Yes, good point. I have a test and actually this issue was fixed in PyMuPDF-1.25.1.