-
Requesting, how to create a form item like form push button, text box etc on a pdf page using pikepdf... |
Beta Was this translation helpful? Give feedback.
Answered by
jbarlow83
Feb 2, 2024
Replies: 1 comment 2 replies
-
You can create the data structures described in the PDF reference manual (linked in the documentation). There's no high level interface for this, unfortunately. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The best way to do is inspect an existing PDF with a form in it. You could use the "Preflight" tool in Acrobat or the free iText RUPS app to see PDF internals; these tools are pretty essential for anyone who works with PDFs. When you see the objects that correspond to the form, usually most of what you need to do is create a pikepdf.Dictionary() object that replicates the same data structure.
You may find it easier to use the Python "borb" library, which does have some basic support for creating PDF forms. (However, it's license is AGPL if that is a concern to you.)