-
Notifications
You must be signed in to change notification settings - Fork 560
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
apply_redactions() does not work as expected #3863
Comments
This post cannot be accepted as a bug report because no reproducer file is provided. |
MuPDF bug report: https://bugs.ghostscript.com/show_bug.cgi?id=708032. |
@nsklei - You are aware that all pages only contain images - no text, no vector graphics. |
Thank you for reviewing my issue and creating a bug report. |
I found that removing page rotation avoids the problem: for page in doc:
page.add_redact_annot(page.rect * page.derotation_matrix)
page.remove_rotation()
page.apply_redactions(images=pymupdf.PDF_REDACT_IMAGE_NONE) Works without problem. |
Thank you for providing a solution to my problem. I tested your suggestion and it works perfectly :) |
Thanks for the feedback! |
@JorjMcKie This appears to have been fixed upstream, so can be marked "fix developed"? |
Fixed in 1.24.11. |
Description of the bug
When using apply_redactions(images=pymupdf.PDF_REDACT_IMAGE_NONE) I get several "MuPDF error: syntax error: cannot find XObject resource" errors and as well there are some pages which are completely empty, altough all pages originally contain images.
How to reproduce the bug
The code above prints the following information:
As you can see, each page contains two images. The function should remove all content from the PDF file except the images.
But when saving the byte_stream there are some pages completely empy.
PyMuPDF version
1.24.10
Operating system
Windows
Python version
3.12
The text was updated successfully, but these errors were encountered: