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 references and formatting #2529

Merged
merged 3 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions pypdf/_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def producer(self) -> Optional[str]:
Read-only property accessing the document's producer.

If the document was converted to PDF from another format, this is the
name of the application (for example, OSX Quartz) that converted it to
name of the application (for example, macOS Quartz) that converted it to
PDF. Returns a ``TextStringObject`` or ``None`` if the producer is not
specified.
"""
Expand Down Expand Up @@ -487,8 +487,8 @@ def named_destinations(self) -> Dict[str, Any]:
"""
return self._get_named_destinations()

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

def get_fields(
self,
Expand Down Expand Up @@ -1896,7 +1896,7 @@ def decrypt(self, password: Union[str, bytes]) -> PasswordType:
password: The password to match.

Returns:
An indicator if the document was decrypted and weather it was the
An indicator if the document was decrypted and whether it was the
owner password or the user password.
"""
if not self._encryption:
Expand Down
24 changes: 11 additions & 13 deletions pypdf/generic/_data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,7 @@ def xmp_metadata(self) -> Optional[PdfObject]:
Retrieve XMP (Extensible Metadata Platform) data relevant to the this
object, if available.

Stability: Added in v1.12, will exist for all future v1.x releases.
See Table 315 – Additional entries in a metadata stream dictionary
See Table 347 — Additional entries in a metadata stream dictionary.

Returns:
Returns a {@link #xmp.XmpInformation XmlInformation} instance
Expand Down Expand Up @@ -969,20 +968,19 @@ def set_data(self, data: bytes) -> None: # deprecated

class ContentStream(DecodedStreamObject):
"""
In order to be fast, this datastructure can contain either:
* raw data in ._data
* parsed stream operations in ._operations
In order to be fast, this data structure can contain either raw data in ._data,
or parsed stream operations in ._operations.
stefan6419846 marked this conversation as resolved.
Show resolved Hide resolved

At any time, ContentStream object can either have one or both of those fields defined,
and zero or one of those fields set to None.
At any time, ContentStream object can either have both of those fields defined,
or one field defined and the other set to None.

Those fields are "rebuilt" lazily, when accessed:
* when .get_data() is called, if ._data is None, it is rebuilt from ._operations
* when .operations is called, if ._operations is None, it is rebuilt from ._data
These fields are "rebuilt" lazily, when accessed:
* when .get_data() is called, if ._data is None, it is rebuilt from ._operations.
* when .operations is called, if ._operations is None, it is rebuilt from ._data.

On the other side, those fields can be invalidated:
* when .set_data() is called, ._operations is set to None
* when .operations is set, ._data is set to None
Conversely, these fields can be invalidated:
* when .set_data() is called, ._operations is set to None.
* when .operations is set, ._data is set to None.
"""

def __init__(
Expand Down