summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/javascript/Document.cpp')
-rw-r--r--fpdfsdk/javascript/Document.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index fa2f7ae4e4..12d8c2df31 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -1348,9 +1348,8 @@ FX_BOOL Document::getPageNthWord(IJS_Context* cc,
if (!pPageDict)
return FALSE;
- CPDF_Page page;
- page.Load(pDocument, pPageDict);
- page.ParseContent(nullptr);
+ CPDF_Page page(pDocument, pPageDict, true);
+ page.ParseContent();
int nWords = 0;
CFX_WideString swRet;
@@ -1404,9 +1403,8 @@ FX_BOOL Document::getPageNumWords(IJS_Context* cc,
if (!pPageDict)
return FALSE;
- CPDF_Page page;
- page.Load(pDocument, pPageDict);
- page.ParseContent(nullptr);
+ CPDF_Page page(pDocument, pPageDict, true);
+ page.ParseContent();
int nWords = 0;
for (auto& pPageObj : *page.GetPageObjectList()) {