-
Notifications
You must be signed in to change notification settings - Fork 510
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
How to use PyMuPDF to generate vertical text? #653
Comments
The simplest way:
The are also lots of other ways, including writing in arbitrary angles (other than int multiples of 90 degrees). |
Any feedback on this? |
I think he/she is probably referring to vertical writing in CJK languages. Here is my example script, modified from this example and #329
If |
@cges30901 - thanks for your comment! You are probably very right. |
So if your assumption applies, the simplest, temporary solution would be to insert linebreaks after each character, wouldn't it? |
I am about to finish the next PyMuPDF version. You can do something like this with it: import fitz
font = fitz.Font("china-s")
doc = fitz.open()
page = doc.newPage()
tw = fitz.TextWriter(page.rect)
text = "直至在專輯製作過程中方被重新發現。"
pos = fitz.Point(250, 70)
fsize = 11
tw.appendv(pos, text, font=font, fontsize=fsize)
tw.writeText(page)
doc.save("some.pdf") Produces this on the PDF page: @cges30901 - do you believe this is the required functionality? |
@JorjMcKie @cges30901 Thank you for your answer. I use CJK languages and have solved this problem according to @cges30901。 |
@JorjMcKie ,I used your answer, but something went wrong,expect the next PyMuPDF version. |
The new version 1.17.7 is underway to be uploaded. Look at PyPI in about half an hour. |
Is this possible translate/rotate an oriented vertical text PDF to horizontal? |
No description provided.
The text was updated successfully, but these errors were encountered: