Is there a way to crop the unused space of a rectangle in pymupdf ? #3634
Replies: 3 comments 5 replies
-
Depending on your insertion method, there are different way how the unused rectangular stripe at the rectangle's bottom is reported back. See documentation for insert_textbox, fill_textbox and insert_htmlbox. All three methods also have ways to control the inter-line distance. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response will check on them
…On Thu, Jun 27, 2024, 8:47 PM Jorj X. McKie ***@***.***> wrote:
Depending on your insertion method, there are different way how the unused
rectangular stripe at the rectangle's bottom is reported back. See
documentation for insert_textbox
<https://pymupdf.readthedocs.io/en/latest/page.html#Page.insert_textbox>,
fill_textbox
<https://pymupdf.readthedocs.io/en/latest/textwriter.html#TextWriter.fill_textbox>
and insert_htmlbox
<https://pymupdf.readthedocs.io/en/latest/page.html#Page.insert_htmlbox>.
Where in reality that empty stripe is located must be interpreted by you
depending on the rotation angle you chose for the text - IAW if you chose
180° then the rectangle will have been filled from bottom to top and the
empty stripe is located at the top accordingly.
Depending on this information, compute the placement of your next text
rectangle.
All three methods also have ways to control the inter-line distance.
—
Reply to this email directly, view it on GitHub
<#3634 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG5HMU43EMDHS2EJDKSHDETZJQUJRAVCNFSM6AAAAABKAAEXKSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TQOJVG4ZDA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Trying this approach, if it solves the issue faced |
Beta Was this translation helpful? Give feedback.
-
The text being written into a rectangle leave some space at the end, need to know if there is a way to crop the unused spaces in a rectangle, so there is no unnecessay white spaces between adjacent lines
Beta Was this translation helpful? Give feedback.
All reactions