Other utilities⚓︎
PyPDFForm offers additional utilities similar to other PDF libraries.
This section of the documentation uses this PDF as an example.
Blank PDFs⚓︎
Use the BlankPage class with PdfWrapper to create new blank PDFs.
The following example generates a PDF with a single blank page:
By default, BlankPage generates a letter-size (612 x 792 points or 8.5 x 11 inches) blank PDF page. To change the dimensions, specify width and height (in points) when you instantiate the object:
Extract pages⚓︎
The PdfWrapper object has a .pages attribute, which is a list of PdfWrapper objects representing individual pages:
from PyPDFForm import PdfWrapper
first_page = PdfWrapper("sample_template.pdf").pages[0]
first_page.fill(
{
"test": "test_1",
"check": True,
},
)
first_page.write("output.pdf")
Merge multiple PDFs⚓︎
You can merge multiple PDF files by adding their PdfWrapper objects. For example, to merge this PDF and this PDF:
Change PDF version⚓︎
PyPDFForm allows you to modify the PDF version up to 2.0: