Index: fpdfsdk/src/fpdftext.cpp |
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp |
index 99f282a2b56a5d82614804bc0e79ed20732d4bd1..b86156557f57950d100d8c8a5e6fab3a31301695 100644 |
--- a/fpdfsdk/src/fpdftext.cpp |
+++ b/fpdfsdk/src/fpdftext.cpp |
@@ -7,6 +7,7 @@ |
#include "../../core/include/fpdfdoc/fpdf_doc.h" |
#include "../../core/include/fpdftext/fpdf_text.h" |
#include "../../public/fpdf_text.h" |
+#include "../include/fsdk_define.h" |
#include "../include/fpdfxfa/fpdfxfa_doc.h" |
#include "../include/fpdfxfa/fpdfxfa_page.h" |
@@ -15,16 +16,13 @@ |
#endif |
DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) { |
- if (!page) |
- return NULL; |
- IPDF_TextPage* textpage = NULL; |
- CPDFXFA_Page* pPage = (CPDFXFA_Page*)page; |
- if (!pPage->GetPDFPage()) |
- return NULL; |
- CPDFXFA_Document* pDoc = pPage->GetDocument(); |
- CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc()); |
- textpage = IPDF_TextPage::CreateTextPage((CPDF_Page*)pPage->GetPDFPage(), |
- viewRef.IsDirectionR2L()); |
+ CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
+ if (!pPage) |
Tom Sepez
2015/10/16 00:18:55
wrong, fix.
Tom Sepez
2015/10/16 16:58:54
reverted.
|
+ return nullptr; |
+ CPDFXFA_Page* pXFAPage = (CPDFXFA_Page*)page; |
+ CPDF_ViewerPreferences viewRef(pXFAPage->m_pDocument); |
+ IPDF_TextPage* textpage = |
+ IPDF_TextPage::CreateTextPage(pPage, viewRef.IsDirectionR2L()); |
textpage->ParseTextPage(); |
return textpage; |
} |