Replies: 4 comments 6 replies
-
I am trying to re render attached PDF. Attached screenshot is where I am having issues |
Beta Was this translation helpful? Give feedback.
-
First PointThere indeed is no direct support of centering (aligning???) vertically. But with a small effort you can achieve the effect. temp = pymupdf.open()
tpage=temp.new_page(width=rect.width, height=rect.height)
rc = tpage.insert_textbox(rect, ...)
temp.close() |
Beta Was this translation helpful? Give feedback.
-
As per your other point:
|
Beta Was this translation helpful? Give feedback.
-
@JorjMcKie I have observed that |
Beta Was this translation helpful? Give feedback.
-
Hi @JorjMcKie
I have 2 things to ask
I am using
insert_textbox
to insert text within providedrect
. I can easily horizontal align usingalign
, but there is no direct way to vertically align.When text is insert in a rect, it is insert on top left. I would want it to vertically align.
How can I vertically align a text in Rect.
This discussion didn't really helped me out cause it uses textwriter in text Link-Discussion-1662
I am also rotating the text within text box. I am using
morph=(point,matrix)
. Origin of rotation is top left as we have point system with us. I can calculate width/2 and height/2 of Rect and rotate accordingly but text rotates based on center of Rect and NOT OF TEXT actually.Would really appreciate your answer. Thanks
Beta Was this translation helpful? Give feedback.
All reactions