diff options
author | James R. Barlow <jim@purplerock.ca> | 2018-07-14 13:52:28 -0700 |
---|---|---|
committer | James R. Barlow <jim@purplerock.ca> | 2018-07-14 13:52:28 -0700 |
commit | d838a98d0cb87107080481c79373feba782879a4 (patch) | |
tree | 2654da9727a2f86bd97ed41911f7f136db5f0e4f /docs/tutorial.rst | |
parent | 1877dd62b29805bb3526e071f4ee1de2759ff9f0 (diff) |
docs: update some remarks about objects
Diffstat (limited to 'docs/tutorial.rst')
-rw-r--r-- | docs/tutorial.rst | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 3f2b71a..fd77bcc 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -56,17 +56,24 @@ follows the ``list`` protocol. As such page numbers begin at 0. odd.extend(odd_pages) odd.save('just-odd-pages.pdf') -Because PDFs are usually numbered in counting numbers (1, 2, 3...), pikepdf -provides a convenience accessor that also uses counting numbers: +Using counting numbers for pages +-------------------------------- + +Because PDF pages are usually numbered in counting numbers (1, 2, 3...), pikepdf +provides a convenience accessor ``.p()`` that uses counting numbers: .. code-block:: python report.pages.p(1) # The first page in the document report.pages[0] # Also the first page in the document del report.pages.p(50) # Drop page 50 + report.pages.p(0) # Exception To avoid confusion, the ``.p()`` accessor does not accept Python slices. +PDFs may define their own numbering scheme or different numberings for +different sections. ``.pages`` does not look up this information. + .. note:: Because of technical limitations in underlying libraries, pikepdf keeps the |