summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_dataavail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdf_dataavail.cpp')
-rw-r--r--fpdfsdk/fpdf_dataavail.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_dataavail.cpp b/fpdfsdk/fpdf_dataavail.cpp
index 6f201d69f1..d7bcf8f5c7 100644
--- a/fpdfsdk/fpdf_dataavail.cpp
+++ b/fpdfsdk/fpdf_dataavail.cpp
@@ -17,6 +17,10 @@
#include "public/fpdf_formfill.h"
#include "third_party/base/ptr_util.h"
+#ifdef PDF_ENABLE_XFA
+#include "fpdfsdk/fpdfxfa/cpdfxfa_context.h"
+#endif // PDF_ENABLE_XFA
+
// These checks are here because core/ and public/ cannot depend on each other.
static_assert(CPDF_DataAvail::DataError == PDF_DATA_ERROR,
"CPDF_DataAvail::DataError value mismatch");
@@ -153,6 +157,11 @@ FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) {
ProcessParseError(error);
return nullptr;
}
+
+#ifdef PDF_ENABLE_XFA
+ document->SetExtension(pdfium::MakeUnique<CPDFXFA_Context>(document.get()));
+#endif // PDF_ENABLE_XFA
+
CheckUnSupportError(document.get(), FPDF_ERR_SUCCESS);
return FPDFDocumentFromCPDFDocument(document.release());
}