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

init_forms: call FPDF_LoadXFA() as necessary (CC #221, #222) #223

Merged
merged 1 commit into from
Jun 6, 2023
Merged

Conversation

mara004
Copy link
Member

@mara004 mara004 commented May 30, 2023

No description provided.

@mara004 mara004 marked this pull request as ready for review May 30, 2023 11:23
@mara004 mara004 linked an issue May 30, 2023 that may be closed by this pull request
raw = pdfium_c.FPDFDOC_InitFormFillEnvironment(self, config)
if not raw:
raise PdfiumError(f"Initializing form env failed for document {self}.")
self.formenv = PdfFormEnv(raw, config, self)

if V_PDFIUM_IS_V8 and formtype in (pdfium_c.FORMTYPE_XFA_FOREGROUND, pdfium_c.FORMTYPE_XFA_FULL):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: want to swap FORMTYPE_XFA_FOREGROUND and FORMTYPE_XFA_FULL

FPDF_LoadXFA() currently seems to be broken in pdfium-binaries.
All the same, add the call so that pypdfium2 is prepared for an
eventual upstream fix.

Currently this only warns on error. Once the aforementioned issue
is fixed, it should be tightened to a PdfiumError exception.

See also #221 #222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XFA not initialized in init_forms()
1 participant