Comments (7)
The bug seems to appear in version 1.24.0 after some testing
from pymupdf.
Please provide reproducing file. So far, we would be forced to guessing.
from pymupdf.
Of course, sorry. This is one page of the doc. I justed tested it and the error happens, though as mention, only after version 1.23.9 it seems
from pymupdf.
Sorry for the delay.
You haven't supplied reproducing code, so I have tried the following, which does not reveal problem behavior (version 1.24.5):
for r in page.search_for("genocide"):
page.add_redact_annot(r)
'Redact' annotation on page 0 of error-doc.pdf
page.apply_redactions()
True
doc.ez_save("redacted.pdf")
pymupdf.version
('1.24.5', '1.24.2', '20240530000001')
from pymupdf.
Of course,
boxes = [some boxes here]
pdf = pymupdf.open(doc_path)
for i, page in enumerate(pdf):
for box in boxes
rect = pymupdf.Rect(
box[0],
box[1],
box[2],
box[3],
)
fontsize = 12
page.add_redact_annot(
rect,
text="[REDACTED]",
text_color=(0, 0, 0),
fill=(1, 0, 0),
fontsize=fontsize,
align=pymupdf.TEXT_ALIGN_CENTER,
)
page.apply_redactions()
path = "somepath"
pdf.save(path)
from pymupdf.
There was a problem with a newer version with .TEXT_ALIGN_CENTER, it may be related to that or something else.
from pymupdf.
Related Issues (20)
- convert_to_pdf() - FzErrorFormat: code=7: truncated jbig2 segment header HOT 3
- OSS-Fuzz Integration HOT 6
- SegFault 11 when empty H1 H2 H3 H4 etc element is used in insert_htmlbox HOT 3
- ZeroDivisionError: float division by zero with page.apply_redactions() HOT 5
- page.links return all links with same xref, is it something possible ?? HOT 6
- Invalid OCGs not ignored by SVG image creation HOT 1
- Redaction Annotation Fill Not Matching Up With Redacted Section HOT 4
- Updating Annotations HOT 1
- False result when finding bounding boxes for lines in blocks. HOT 6
- For what reason IRect exists? HOT 1
- MuPDF error: argument error: not a dict (string) HOT 3
- Get image inside table's cell
- `'width'` in `Page.get_drawings()` returns width equal as 0 HOT 2
- trouble in page.find_tables HOT 1
- Garbled extraction for Amazon Sustainability Report HOT 6
- This pdf would cause stack overflow exception, HOT 3
- ImportError: DLL load failed while importing _extra: The specified module could not be found. HOT 1
- Story.fit_width() has a weird line HOT 2
- The position box obtained through the get_text() method is inaccurate HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pymupdf.