Missing XFA tests

36 views
Skip to first unread message

Jeroen Bobbeldijk

unread,
Apr 19, 2024, 3:49:34 AMApr 19
to pdfium
Hi there,

I'm currently implementing XFA into go-pdfium, I mostly base my unit tests on the tests in pdfium itself as it's just easier because then I know the expected outcomes and I can use the same example PDFs. 

For XFA I noticed that almost none of the XFA methods are tested, and also have no example PDFs, is this something I missed in the codebase or is the XFA implementation tested somewhere else? Or is it just not tested?

Thanks!

Jeroen

K. Moon

unread,
Apr 19, 2024, 3:26:10 PMApr 19
to Jeroen Bobbeldijk, pdfium
The XFA implementation is not complete. I wouldn't try to use it.

--
You received this message because you are subscribed to the Google Groups "pdfium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/1f926089-90b7-4c23-9fd2-cc4ba40292bcn%40googlegroups.com.

Jeroen Bobbeldijk

unread,
Apr 19, 2024, 3:28:15 PMApr 19
to pdfium
Do you mean that not all of XFA is supported? Or that what's currently in pdfium has not been fully implemented?

K. Moon

unread,
Apr 19, 2024, 3:31:50 PMApr 19
to Jeroen Bobbeldijk, pdfium
The XFA support in PDFium today is essentially unfinished. Common XFA forms in the wild do not work. As far as I'm aware, no resources are being put into finishing XFA support.

Jeroen Bobbeldijk

unread,
Apr 19, 2024, 3:33:39 PMApr 19
to pdfium
Alright, thanks for the context! I think I will leave support for it in go-pdfium if anyone wants to try/use it, but without the unit tests.

geisserml

unread,
Apr 19, 2024, 6:24:01 PMApr 19
to pdfium
> For XFA I noticed that almost none of the XFA methods are tested, and also have no example PDFs, is this something I missed in the codebase or is the XFA implementation tested somewhere else? Or is it just not tested?

FWIW, there certainly do seem to be XFA tests in pdfium. If you have a full checkout, in testing/resources/, there will be xfa/, pixel/xfa_specific/, javascript/xfa_specific/ to name a few.
Or testing/corpus/xfa_specific, which you can also view here: https://pdfium.googlesource.com/pdfium_tests/+/refs/heads/main/xfa_specific
A GH search yields various test cases where these are accessed, including in fpdfsdk/fpdf_formfill_embeddertest.cpp, xfa/fwl/cfwl_edit_embeddertest.cpp, testing/fuzzers/*xfa*, and so on.

Jeroen Bobbeldijk

unread,
Apr 22, 2024, 3:34:40 AMApr 22
to pdfium
Yeah there are some tests for XFA documents, these mainly test the rendering of XFA documents, the tests I was looking for are for the XFA callback methods in FPDF_FORMFILLINFO and IPDF_JSPLATFORM.

Lei Zhang

unread,
Apr 23, 2024, 1:49:13 PMApr 23
to Jeroen Bobbeldijk, pdfium
As a concrete example,
testing/resources/javascript/xfa_specific/xfa_host_pseudomodel.in
exercises Form_SetCurrentPage() and probably some other XFA callbacks.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/37fcb385-2338-495c-b9fd-799f3d3faa6dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages