Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ You can contribute to `pypdf on GitHub <https://github.com/py-pdf/pypdf>`_.
user/file-size
user/pdf-version-support
user/pdfa-compliance
outlines


.. toctree::
Expand Down
27 changes: 27 additions & 0 deletions docs/outlines.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
=========================
Working with Outlines
=========================

Outlines (also known as bookmarks) are used to create a clickable table of contents in a PDF.

Reading outlines
-----------------
.. code-block:: python

from pypdf import PdfReader

reader = PdfReader("example.pdf")
outlines = reader.outline
for item in outlines:
print(item)

Adding outlines
----------------
.. code-block:: python

from pypdf import PdfWriter

writer = PdfWriter()
writer.add_blank_page(width=200, height=200)
writer.add_outline_item("My First Page", 0)
writer.write("output.pdf")
Loading