Manipulating pages¶
pikepdf presents the pages in a PDF through the pikepdf.Pdf.pages
property, which follows the list
protocol. As such page numbers begin at 0.
Since one of the most things people want to do is split and merge PDF pages, we’ll by exploring that.
Let’s look at a simple PDF that contains four pages.
In [1]: from pikepdf import Pdf
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-5d5e0079e556> in <module>()
----> 1 from pikepdf import Pdf
ModuleNotFoundError: No module named 'pikepdf'
In [2]: pdf = Pdf.open('../tests/resources/fourpages.pdf')