Skip to content

Commit

Permalink
PPF-758: this is new
Browse files Browse the repository at this point in the history
  • Loading branch information
chinapandaman committed Dec 5, 2024
1 parent 6c61393 commit 4594aac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion PyPDFForm/filler.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def simple_fill(

for page in out.pages:
for annot in page.get(Annots, []): # noqa
annot = cast(DictionaryObject, annot.get_object())
annot = cast("DictionaryObject", annot.get_object())
key = get_widget_key(annot.get_object())

widget = widgets.get(key)
Expand Down
3 changes: 1 addition & 2 deletions PyPDFForm/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from typing import Dict, List, Tuple, Union, cast

from pypdf import PdfReader, PdfWriter
from pypdf.generic import DictionaryObject
from reportlab.pdfbase.pdfmetrics import stringWidth

from .constants import (COMB, DEFAULT_FONT_SIZE, MULTILINE, NEW_LINE_SYMBOL,
Expand Down Expand Up @@ -426,7 +425,7 @@ def update_widget_key(

for page in out.pages:
for annot in page.get(Annots, []): # noqa
annot = cast(DictionaryObject, annot.get_object())
annot = cast("DictionaryObject", annot.get_object())
key = get_widget_key(annot.get_object())

widget = widgets.get(key)
Expand Down
3 changes: 1 addition & 2 deletions PyPDFForm/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import List, cast

from pypdf import PdfReader, PdfWriter
from pypdf.generic import DictionaryObject
from reportlab.lib.colors import Color
from reportlab.pdfgen.canvas import Canvas

Expand Down Expand Up @@ -100,7 +99,7 @@ def handle_non_acro_form_params(pdf: bytes, key: str, params: list) -> bytes:

for page in out.pages:
for annot in page.get(Annots, []): # noqa
annot = cast(DictionaryObject, annot.get_object())
annot = cast("DictionaryObject", annot.get_object())
_key = get_widget_key(annot.get_object())

if _key == key:
Expand Down

0 comments on commit 4594aac

Please sign in to comment.