-
Notifications
You must be signed in to change notification settings - Fork 506
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 hides Path objects from macOS Preview/Quicklook/Safari #3748
Comments
Please consult the documentation of apply_redactions! |
Hi, I have similar issue. Just to clarify that the "text: 1" for apply_redactions is working properly, however the text was somehow masked or so. Refer to the image from Preview app which I can still select the text and copy it out. The only thing is the text on the left section seems to be transparent. The expectation is the text is fully visible as this is not part of the redacted regions. Hope this helps. Thanks. |
@JorjMcKie Thank you for the quick reply. I have tried the various graphics and image handling options in the apply redactions documentation, but the issue remains. Please note none of the redact rectangles overlap the path drawings that appear to be removed. (see original post attachment 2 redact rects.pdf) Our use-case requires that we do remove overlapping text, images, and drawings. The issue remains in these new example files created with this code: import pymupdf
doc = pymupdf.open("1 source.pdf")
for page in doc:
page.add_redact_annot([0, 792, 612, 600])
page.apply_redactions(graphics=pymupdf.PDF_REDACT_LINE_ART_NONE)
doc.save("3 PDF_REDACT_LINE_ART_NONE.pdf")
doc.close() |
@beeing please open a separate issue - your situation is not the same. |
@mac5yver - thanks for your reply. I have opened the redacted (result) file with all the PDF viewers I usually employ - and it does look perfectly ok with all of them: evince (Linux), Adobe Acrobat, PDF XChange Viwer, Nitro, Foxit reader, MuPDF. |
@JorjMcKie Thanks for your time. We regularly employ macOS Preview as a PDF viewer, but do also have access to Acrobat. We'll just have to find a way to ensure the redacted PDFs are never opened or printed from Preview or Safari, since the apparent result is incorrect. |
I encountered a similar issue with the newly generated PDF files after using the |
@yuhuang-cst Agree that this "PDF doesn't display correctly in Preview after redactions take place" is a serious issue - we will hopefully get to the bottom of it on #3751 |
Description of the bug
Path objects (paragraph rules, paragraph borders) in a PDF created by Adobe InDesign become hidden or invisible to macOS Preview, Safari, and Quicklook after applying redactions.
Preview shows all the paths of '1 source.pdf' correctly but after redaction ('3 apply redactions.pdf') none of these Path objects are visible in Preview (see 'preview.png'). The content structure of both documents appear to be the same (see 'compare content.png'), but something seems to have changed as a result of redaction. The Paths render correctly in Acrobat and Chrome on macOS.
How to reproduce the bug
I would expect that after applying redactions the Paths would continue to be visible in Preview/Quicklook but they are not.
1 source.pdf
2 redact rects.pdf
3 apply redactions.pdf
preview.png
compare content.png
PyMuPDF version
1.24.9
Operating system
MacOS
Python version
3.12
The text was updated successfully, but these errors were encountered: