Skip to content

Commit 033e763

Browse files
authored
DOC: Update references and formatting (#2529)
1 parent bbbc9dd commit 033e763

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

docs/meta/faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ In BibTeX format:
4848
Martin Thoma and
4949
Matthew Peveler and
5050
exiledkingcc and {pypdf Contributors}},
51-
year = {2022},
51+
year = {2024},
5252
url = {https://pypi.org/project/pypdf/}
5353
note = {See https://pypdf.readthedocs.io/en/latest/meta/CONTRIBUTORS.html for all contributors}
5454
}

pypdf/_reader.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def producer(self) -> Optional[str]:
213213
Read-only property accessing the document's producer.
214214
215215
If the document was converted to PDF from another format, this is the
216-
name of the application (for example, OSX Quartz) that converted it to
216+
name of the application (for example, macOS Quartz) that converted it to
217217
PDF. Returns a ``TextStringObject`` or ``None`` if the producer is not
218218
specified.
219219
"""
@@ -487,8 +487,8 @@ def named_destinations(self) -> Dict[str, Any]:
487487
"""
488488
return self._get_named_destinations()
489489

490-
# A select group of relevant field attributes. For the complete list,
491-
# see section 8.6.2 of the PDF 1.7 reference.
490+
# A select group of relevant field attributes. For the complete list.
491+
# See §12.3.2 of the PDF 1.7 or PDF 2.0 specification.
492492

493493
def get_fields(
494494
self,
@@ -1896,7 +1896,7 @@ def decrypt(self, password: Union[str, bytes]) -> PasswordType:
18961896
password: The password to match.
18971897
18981898
Returns:
1899-
An indicator if the document was decrypted and weather it was the
1899+
An indicator if the document was decrypted and whether it was the
19001900
owner password or the user password.
19011901
"""
19021902
if not self._encryption:

pypdf/generic/_data_structures.py

+15-13
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,10 @@ def xmp_metadata(self) -> Optional[PdfObject]:
390390
Retrieve XMP (Extensible Metadata Platform) data relevant to the this
391391
object, if available.
392392
393-
Stability: Added in v1.12, will exist for all future v1.x releases.
394-
See Table 315 – Additional entries in a metadata stream dictionary
393+
See Table 347 — Additional entries in a metadata stream dictionary.
395394
396395
Returns:
397-
Returns a {@link #xmp.XmpInformation XmlInformation} instance
396+
Returns a :class:`~pypdf.xmp.XmpInformation` instance
398397
that can be used to access XMP metadata from the document. Can also
399398
return None if no metadata was found on the document root.
400399
"""
@@ -969,20 +968,23 @@ def set_data(self, data: bytes) -> None: # deprecated
969968

970969
class ContentStream(DecodedStreamObject):
971970
"""
972-
In order to be fast, this datastructure can contain either:
971+
In order to be fast, this data structure can contain either:
972+
973973
* raw data in ._data
974-
* parsed stream operations in ._operations
974+
* parsed stream operations in ._operations.
975+
976+
At any time, ContentStream object can either have both of those fields defined,
977+
or one field defined and the other set to None.
978+
979+
These fields are "rebuilt" lazily, when accessed:
975980
976-
At any time, ContentStream object can either have one or both of those fields defined,
977-
and zero or one of those fields set to None.
981+
* when .get_data() is called, if ._data is None, it is rebuilt from ._operations.
982+
* when .operations is called, if ._operations is None, it is rebuilt from ._data.
978983
979-
Those fields are "rebuilt" lazily, when accessed:
980-
* when .get_data() is called, if ._data is None, it is rebuilt from ._operations
981-
* when .operations is called, if ._operations is None, it is rebuilt from ._data
984+
Conversely, these fields can be invalidated:
982985
983-
On the other side, those fields can be invalidated:
984-
* when .set_data() is called, ._operations is set to None
985-
* when .operations is set, ._data is set to None
986+
* when .set_data() is called, ._operations is set to None.
987+
* when .operations is set, ._data is set to None.
986988
"""
987989

988990
def __init__(

0 commit comments

Comments
 (0)