Skip to content

Commit ff561f4

Browse files
authored
STY: Tweak PdfWriter (#3337)
1 parent e9e3735 commit ff561f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pypdf/_writer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def __init__(
209209

210210
self._info_obj: Optional[PdfObject]
211211
"""The PDF files's document information dictionary,
212-
the Info entry in the PDF file's trailer dictionary."""
212+
defined by Info in the PDF file's trailer dictionary."""
213213

214214
self._ID: Union[ArrayObject, None] = None
215215
"""The PDF file identifier,
@@ -625,7 +625,7 @@ def insert_page(
625625
"""
626626
assert self.flattened_pages is not None, "mypy"
627627
if index < 0:
628-
index = len(self.flattened_pages) + index
628+
index += len(self.flattened_pages)
629629
if index < 0:
630630
raise ValueError("Invalid index value")
631631
if index >= len(self.flattened_pages):
@@ -690,7 +690,7 @@ def insert_blank_page(
690690
"""
691691
Insert a blank page to this PDF file and return it.
692692
693-
If no page size is specified, use the size of the last page.
693+
If no page size is specified for a dimension, use the size of the last page.
694694
695695
Args:
696696
width: The width of the new page expressed in default user

0 commit comments

Comments
 (0)