summaryrefslogtreecommitdiff
path: root/docs/tutorial.rst
diff options
context:
space:
mode:
authorJames R. Barlow <jim@purplerock.ca>2018-07-14 13:52:28 -0700
committerJames R. Barlow <jim@purplerock.ca>2018-07-14 13:52:28 -0700
commitd838a98d0cb87107080481c79373feba782879a4 (patch)
tree2654da9727a2f86bd97ed41911f7f136db5f0e4f /docs/tutorial.rst
parent1877dd62b29805bb3526e071f4ee1de2759ff9f0 (diff)
docs: update some remarks about objects
Diffstat (limited to 'docs/tutorial.rst')
-rw-r--r--docs/tutorial.rst11
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