Skip to content

Commit

Permalink
DOC: Update annotation list (#2534)
Browse files Browse the repository at this point in the history
Copied in order from Table 171 annotation types of the PDF 2.0 Specification. The three added annotations are Redact (PDF 1.7), Projection (PDF 2.0) and RichMedia (PDF 2.0).
  • Loading branch information
j-t-1 authored Mar 23, 2024
1 parent 033e763 commit d0d8bc5
Showing 1 changed file with 22 additions and 7 deletions.
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

0 comments on commit d0d8bc5

Please sign in to comment.