Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Update annotation list #2534

Merged
merged 1 commit into from
Mar 23, 2024
Merged
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
29 changes: 22 additions & 7 deletions docs/user/reading-pdf-annotations.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
# Reading PDF Annotations

PDF 1.7 defines 25 different annotation types:
PDF 2.0 defines the following annotation types:

* Text
* Link
* FreeText
* Line, Square, Circle, Polygon, PolyLine, Highlight, Underline, Squiggly, StrikeOut
* Stamp, Caret, Ink
* Line
* Square
* Circle
* Polygon
* PolyLine
* Highlight
* Underline
* Squiggly
* StrikeOut
* Caret
* Stamp
* Ink
* Popup
* FileAttachment
* Sound, Movie
* Widget, Screen
* Sound
* Movie
* Screen
* Widget
* PrinterMark
* TrapNet
* Watermark
* 3D
* Redact
* Projection
* RichMedia

In general, annotations can be read like this:

```python
from pypdf import PdfReader

reader = PdfReader("commented.pdf")
reader = PdfReader("annotated.pdf")

for page in reader.pages:
if "/Annots" in page:
Expand Down Expand Up @@ -53,7 +68,7 @@ for page in reader.pages:
```python
from pypdf import PdfReader

reader = PdfReader("commented.pdf")
reader = PdfReader("example.pdf")

for page in reader.pages:
if "/Annots" in page:
Expand Down