Skip to content
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

Search problems #4180

Open
vlad-babin opened this issue Dec 26, 2024 · 1 comment
Open

Search problems #4180

vlad-babin opened this issue Dec 26, 2024 · 1 comment
Labels
upstream bug bug outside this package

Comments

@vlad-babin
Copy link

Description of the bug

Hello!
I have issues with searching in the document.

The problem is that the search results provide coordinates slightly above the actual line in the file.

This issue occurs in files that had the problem described in this #3751 (comment) before version 1.24.14.

I’m attaching the files for reference.
original.pdf
redacted.pdf

How to reproduce the bug

Here is the script that performs the search and deletes the lines.

input_file_path = request.kwargs["inputFilePath"]
search_value = "Reference is made"

doc = pymupdf.open(input_file_path)

for page in doc:
    instances = page.search_for(search_value)
    for inst in instances:
        page.add_redact_annot(inst, fill=(0, 0, 0))
    page.apply_redactions()

doc.save('redacted_document.pdf')
doc.close()

PyMuPDF version

1.25.0

Operating system

MacOS

Python version

3.12

@JorjMcKie
Copy link
Collaborator

Thank you for your submission. As mentioned in the referenced Discussions item, this may be a MuPDF bug. I am therefore going to submit an issue in their system referring to this report.

Here is the link to the MuPDF issue: https://bugs.ghostscript.com/show_bug.cgi?id=708222

@JorjMcKie JorjMcKie added the upstream bug bug outside this package label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream bug bug outside this package
Projects
None yet
Development

No branches or pull requests

2 participants