diff --git a/pypdf/_reader.py b/pypdf/_reader.py index 809ccda83..d37635b29 100644 --- a/pypdf/_reader.py +++ b/pypdf/_reader.py @@ -164,7 +164,7 @@ def _info(self) -> Optional[DictionaryObject]: Provide access to "/Info". standardized with PdfWriter. Returns: - /Info Dictionary ; None if the entry does not exists + /Info Dictionary; None if the entry does not exist """ info = self.trailer.get(TK.INFO, None) if info is None: @@ -183,7 +183,7 @@ def _ID(self) -> Optional[ArrayObject]: Provide access to "/ID". standardized with PdfWriter. Returns: - /ID array ; None if the entry does not exists + /ID array; None if the entry does not exist """ id = self.trailer.get(TK.ID, None) return None if id is None else cast(ArrayObject, id.get_object()) diff --git a/pypdf/_writer.py b/pypdf/_writer.py index 62fdf0e86..61e724bec 100644 --- a/pypdf/_writer.py +++ b/pypdf/_writer.py @@ -154,17 +154,6 @@ class PdfWriter(PdfDocCommon): Typically data is added from a :class:`PdfReader`. """ - # for commonality - @property - def is_encrypted(self) -> bool: - """ - Read-only boolean property showing whether this PDF file is encrypted. - - Note that this property, if true, will remain true even after the - :meth:`decrypt()` method is called. - """ - return False - def __init__( self, fileobj: Union[None, PdfReader, StrByteType, Path] = "", @@ -252,6 +241,17 @@ def _get_clone_from( self._encrypt_entry: Optional[DictionaryObject] = None self._ID: Union[ArrayObject, None] = None + # for commonality + @property + def is_encrypted(self) -> bool: + """ + Read-only boolean property showing whether this PDF file is encrypted. + + Note that this property, if true, will remain true even after the + :meth:`decrypt()` method is called. + """ + return False + @property def root_object(self) -> DictionaryObject: """ @@ -2471,7 +2471,7 @@ def merge( elif isinstance(dest["/Page"], NullObject): pass elif isinstance(dest["/Page"], int): - # the page reference is a page number normally not iaw Pdf Reference + # the page reference is a page number normally not a PDF Reference # page numbers as int are normally accepted only in external goto p = reader.pages[dest["/Page"]] assert p.indirect_reference is not None