Rotation of Redaction Text #1729
Replies: 3 comments 3 replies
-
Text rotation is not supported with redactions. It is however with freetext annotations (multiples of 90°). Redaction text, in the end, will become regular text of the page (in contrast to freetext annots). |
Beta Was this translation helpful? Give feedback.
-
Here is a screen shot of the add_highlight_annot() result. You can see the curved ends of the annotation area. It looks this way if I render it with pymupdf to image or use any number of PDF viewers. I have a document where the text is displayed going from left to right but the document is actually rotated 90. If tried adjusting the page rotation first and then apply the annotation, as well as chaning the coordinates but I can't get the annotation to work properly. I was able to get around the issue with Redactions and text writing by using your solution of using the freetext annotation for the text. I just can't figure out how to do a highlight redaction and get it to obey the actual page rotation. |
Beta Was this translation helpful? Give feedback.
-
These are highlight annotations, no redactions! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When I create redactions, the redaction box is correctly placed over the text, but that is passed in to fill in the redaction box, is written vertically. My document is show in landscape mode and visually the text runs left to right, but it is actually rotated 90 and the direction of the text is (0.0, -1.0).
The redaction box is covering the text as expected, but the text that is written into the redaction area is written as if the page is un-rotated. I have tried to ROTATE the annotation 90 and write the text but it always comes out this way. My code is as follows:
redaction = page.add_redact_annot(quad=text_coords, text=redaction_text, textcolor=(1.0,1.0,1.0), fill=(0.0,0.0,0.0), cross_out=False)
redaction.set_colors(fill_color, stroke_color)
highlight.set_info(info=redaction_info)
highlight.update()
I noticed in the code for add_redact_anon() that it is always setting the page rotation to 0 so it seems there is NO way to actually get the text to write out properly? I have tried setting the page rotation to 0 before any of the above calls, but it doesn't help.
Any thoughts on HOW to get the rotation of the text in the redaction box to match what I want? I have the same problem with regular annotations as well.
Beta Was this translation helpful? Give feedback.
All reactions