Index: fpdfsdk/src/fpdftext.cpp |
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp |
index 7675dada6184fba59dc70bf7dcdcb003eebe0b76..26017fe7906050277e9ff0aa5e5b26dc78ff8ba0 100644 |
--- a/fpdfsdk/src/fpdftext.cpp |
+++ b/fpdfsdk/src/fpdftext.cpp |
@@ -6,16 +6,29 @@ |
#include "public/fpdf_text.h" |
+#ifdef PDF_ENABLE_XFA |
#include "../include/fpdfxfa/fpdfxfa_doc.h" |
#include "../include/fpdfxfa/fpdfxfa_page.h" |
+#endif |
#include "core/include/fpdfdoc/fpdf_doc.h" |
#include "core/include/fpdftext/fpdf_text.h" |
+#ifndef PDF_ENABLE_XFA |
+#include "fpdfsdk/include/fsdk_define.h" |
+#endif |
#ifdef _WIN32 |
#include <tchar.h> |
#endif |
DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) { |
+#ifndef PDF_ENABLE_XFA |
Lei Zhang
2015/11/25 00:34:30
Use UnderlyingPageType here?
Tom Sepez
2015/11/25 21:45:29
Unified a bit.
|
+ CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
+ if (!pPage) |
+ return nullptr; |
+ CPDF_ViewerPreferences viewRef(pPage->m_pDocument); |
+ IPDF_TextPage* textpage = |
+ IPDF_TextPage::CreateTextPage(pPage, viewRef.IsDirectionR2L()); |
+#else |
if (!page) |
return NULL; |
IPDF_TextPage* textpage = NULL; |
@@ -26,6 +39,7 @@ DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) { |
CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc()); |
textpage = IPDF_TextPage::CreateTextPage((CPDF_Page*)pPage->GetPDFPage(), |
viewRef.IsDirectionR2L()); |
+#endif |
textpage->ParseTextPage(); |
return textpage; |
} |