Skip to content

Commit 6226d66

Browse files
authored
DOC: Update PDF standard references (#2640)
1 parent 32f826b commit 6226d66

File tree

5 files changed

+19
-30
lines changed

5 files changed

+19
-30
lines changed

docs/user/pdf-version-support.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ PDF comes in the following versions:
99
* 2001: 1.4
1010
* 2003: 1.5
1111
* 2004: 1.6
12-
* 2006 - 2012: 1.7, ISO 32000-1:2008
13-
* 2017: 2.0
12+
* 2008: 1.7, ISO 32000-1:2008
13+
* 2017: 2.0, ISO 32000-2:2017
1414

1515
The general format didn't change, but new features got added. It can be that
1616
pypdf can do the operations you want on PDF 2.0 files without fully supporting

docs/user/robustness.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Robustness and strict=False
22

3-
PDF is [specified in various versions](https://www.pdfa.org/resource/pdf-specification-index/).
4-
The specification of PDF 1.7 has 978 pages. This length makes it hard to get
3+
PDF is [specified in various versions](https://pdfa.org/resource/pdf-specification-archive/).
4+
The specification of PDF 2.0 has 1003 pages. This length makes it hard to get
55
everything right. As a consequence, a lot of PDF files are not strictly following the
66
specification.
77

pypdf/_writer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ def encrypt(
11711171
encryption. When false, 40bit encryption will be used.
11721172
By default, this flag is on.
11731173
permissions_flag: permissions as described in
1174-
TABLE 3.20 of the PDF 1.7 specification. A bit value of 1 means
1174+
Table 3.20 of the PDF 1.7 specification. A bit value of 1 means
11751175
the permission is grantend.
11761176
Hence an integer value of -1 will set all flags.
11771177
Bit position 3 is for printing, 4 is for modifying content,
@@ -1481,7 +1481,7 @@ def get_reference(self, obj: PdfObject) -> IndirectObject:
14811481

14821482
def get_outline_root(self) -> TreeObject:
14831483
if CO.OUTLINES in self._root_object:
1484-
# TABLE 3.25 Entries in the catalog dictionary
1484+
# Table 3.25 Entries in the catalog dictionary
14851485
outline = cast(TreeObject, self._root_object[CO.OUTLINES])
14861486
if not isinstance(outline, TreeObject):
14871487
t = TreeObject(outline)
@@ -1509,7 +1509,7 @@ def get_threads_root(self) -> ArrayObject:
15091509
``/I`` properties.
15101510
"""
15111511
if CO.THREADS in self._root_object:
1512-
# TABLE 3.25 Entries in the catalog dictionary
1512+
# Table 3.25 Entries in the catalog dictionary
15131513
threads = cast(ArrayObject, self._root_object[CO.THREADS])
15141514
else:
15151515
threads = ArrayObject()

pypdf/constants.py

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""
2-
See Portable Document Format Reference Manual, 1993. ISBN 0-201-62628-4.
2+
PDF Specification Archive
3+
https://pdfa.org/resource/pdf-specification-archive/
34
4-
See https://ia802202.us.archive.org/8/items/pdfy-0vt8s-egqFwDl7L2/PDF%20Reference%201.0.pdf
5+
Portable Document Format Reference Manual, 1993. ISBN 0-201-62628-4
6+
https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/pdfreference1.0.pdf
57
6-
PDF Reference, third edition, Version 1.4, 2001. ISBN 0-201-75839-3.
8+
ISO 32000-1:2008 (PDF 1.7)
9+
https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf
710
8-
PDF Reference, sixth edition, Version 1.7, 2006.
9-
10-
ISO 32000-2:2020 (PDF 2.0).
11+
ISO 32000-2:2020 (PDF 2.0)
1112
"""
1213

1314
from enum import IntFlag, auto
@@ -290,13 +291,7 @@ class StreamAttributes:
290291

291292

292293
class FilterTypes:
293-
"""
294-
Table 4.3 of the 1.4 Manual.
295-
296-
Page 354 of the 1.7 Manual.
297-
298-
Table 6 of the 2.0 manual.
299-
"""
294+
"""§7.4 of the 1.7 and 2.0 references."""
300295

301296
ASCII_HEX_DECODE = "/ASCIIHexDecode" # abbreviation: AHx
302297
ASCII_85_DECODE = "/ASCII85Decode" # abbreviation: A85
@@ -309,10 +304,7 @@ class FilterTypes:
309304

310305

311306
class FilterTypeAbbreviations:
312-
"""
313-
Table 4.44 of the 1.7 Manual (page 353ff).
314-
Table 92 of the 2.0 manual.
315-
"""
307+
"""§8.9.7 of the 1.7 and 2.0 references."""
316308

317309
AHx = "/AHx"
318310
A85 = "/A85"
@@ -353,7 +345,7 @@ class CcittFaxDecodeParameters:
353345

354346

355347
class ImageAttributes:
356-
"""Table 4.39 PDF Reference 1.7 page 340+"""
348+
"""§11.6.5 of the 1.7 and 2.0 references."""
357349

358350
TYPE = "/Type" # name, required; must be /XObject
359351
SUBTYPE = "/Subtype" # name, required; must be /Image
@@ -638,10 +630,7 @@ class GraphicsStateParameters:
638630

639631

640632
class CatalogDictionary:
641-
"""
642-
Table 3.25 in the 1.7 reference.
643-
Table 29 in the 2.0 reference.
644-
"""
633+
"""§7.7.2 of the 1.7 and 2.0 references."""
645634

646635
TYPE = "/Type" # name, required; must be /Catalog
647636
VERSION = "/Version" # name

pypdf/generic/_data_structures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ class Destination(TreeObject):
14251425
"""
14261426
A class representing a destination within a PDF file.
14271427
1428-
See section 8.2.1 of the PDF 1.6 reference.
1428+
See section 12.3.2 of the PDF 2.0 reference.
14291429
14301430
Args:
14311431
title: Title of this destination.

0 commit comments

Comments
 (0)