Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Small size after apply fitz.TOOLS.set_small_glyph_heights(True) #3509

Closed
Muhammadraafat1 opened this issue May 22, 2024 · 2 comments
Closed
Labels
not a bug not a bug / user error / unable to reproduce

Comments

@Muhammadraafat1
Copy link

Muhammadraafat1 commented May 22, 2024

Description of the bug

I was have a issue "After applying redactions with Page.add_redact_annot() some text disappears" but I applied set_small_glyph_heights and it works well, but the fontsize became small even I determined it by 20 and it's not effected

for example:
image

image

How to reproduce the bug

``

for page in doc:
        fitz.TOOLS.set_small_glyph_heights(True)
        for word , replace in `replacements.items():`
            wlist = page.search_for(word)
            for rect in wlist:
                redaction = page.add_redact_annot(
                    rect,
                    text=replace,
                    align=fitz.TEXT_ALIGN_CENTER,
                    `fontsize=20`
                )
        page.apply_redactions()
    doc.save(output_pdf)

``

PyMuPDF version

1.24.4

Operating system

Windows

Python version

3.12

@JorjMcKie
Copy link
Collaborator

The fontsize will be automatically adjusted to smaller values until the full text string fits into the redaction (!) rectangle.
If you reduced the redaction rectangle height, then this is what happens.

@JorjMcKie JorjMcKie added the not a bug not a bug / user error / unable to reproduce label May 22, 2024
@Muhammadraafat1
Copy link
Author

@JorjMcKie
There is no way to make customization to keep fontsize as the font of original text?

@pymupdf pymupdf locked and limited conversation to collaborators May 23, 2024
@JorjMcKie JorjMcKie converted this issue into discussion #3514 May 23, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
not a bug not a bug / user error / unable to reproduce
Projects
None yet
Development

No branches or pull requests

2 participants