Repository navigation
Create a blank PDF document and add a line of text to it #3749
hoehermann
started this conversation in
Show and tell
Replies: 1 comment
pypdf currently primarily provides high-level APIs for the main objects, but not for modifying the content streams itself, yes. While it is possible of course, there are more pitfalls and a proper high-level API would be much more complex. For creating PDF files, other libraries like fpdf2 or reportlab already exist and provide some suitable high-level interfaces. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are many questions and answers regarding removing text, but I found no information about adding text. There seems to be no example in the documentation either. Figuring out the content stream is not perfectly trivial, but eventually I came up with this small tool which creates a document and adds text to one page:
This example should also help if someone wants to modify the content stream in a document.
All reactions