Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1191)

Unified Diff: fpdfsdk/src/fpdfview.cpp

Issue 939483003: Keep the declaration of FPDF_HasXFAField consistent with other XFA APIs (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdfsave.cpp ('k') | fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfview.cpp
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index f726fc9ae08fd9ff7bb515bd8ac71e54f29cfc26..a2eecb318682fde4028332e670f7a737c68b57e3 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -302,6 +302,39 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BY
CPDFXFA_Document* pDocument = FX_NEW CPDFXFA_Document(pPDFDoc, pProvider);
return pDocument;
}
+
+DLLEXPORT FX_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document, int& docType)
+{
+ if (!document)
+ return FALSE;
+
+ CPDF_Document * pPDFDoc = ((CPDFXFA_Document*)document)->GetPDFDoc();
+ if (!pPDFDoc)
+ return FALSE;
+
+ CPDF_Dictionary* pRoot = pPDFDoc->GetRoot();
+ if (!pRoot)
+ return FALSE;
+
+ CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm");
+ if (!pAcroForm)
+ return FALSE;
+
+ CPDF_Object* pXFA = pAcroForm->GetElement("XFA");
+ if (!pXFA)
+ return FALSE;
+
+ FX_BOOL bDymasticXFA = FALSE;
Tom Sepez 2015/02/17 22:16:34 nit: Dymastic isn't a word as far as I know. Did
+ bDymasticXFA = pRoot->GetBoolean("NeedsRendering", FALSE);
+
+ if (bDymasticXFA)
+ docType = DOCTYPE_DYNIMIC_XFA;
+ else
+ docType = DOCTYPE_STATIC_XFA;
+
+ return TRUE;
+}
+
DLLEXPORT FPDF_BOOL STDCALL FPDF_LoadXFA(FPDF_DOCUMENT document)
{
if (!document||!((CPDFXFA_Document*)document)->GetPDFDoc())
« no previous file with comments | « fpdfsdk/src/fpdfsave.cpp ('k') | fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698