Skip to content

Commit

Permalink
Only attempt to load XFA if the build supports it
Browse files Browse the repository at this point in the history
  • Loading branch information
mara004 committed May 27, 2023
1 parent 857673b commit 5991174
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pypdfium2/_helpers/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def init_forms(self, config=None):
raise PdfiumError(f"Initializing form env failed for document {self}.")
self.formenv = PdfFormEnv(raw, config, self)

if formtype in (pdfium_c.FORMTYPE_XFA_FOREGROUND, pdfium_c.FORMTYPE_XFA_FULL):
if V_PDFIUM_IS_V8 and formtype in (pdfium_c.FORMTYPE_XFA_FOREGROUND, pdfium_c.FORMTYPE_XFA_FULL):
ok = pdfium_c.FPDF_LoadXFA(self)
if not ok:
# apparently always fails (probably a bug), thus warn instead of rasing an exception for now
Expand Down

0 comments on commit 5991174

Please sign in to comment.