diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-03-03 13:10:49 -0500 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2019-03-26 11:15:38 +0100 |
commit | f08b80fc1a4a4cadc320043aef0ff01090a23d44 (patch) | |
tree | c4a8fea74bb9c85a625f7171e3c94abd43b2d6d8 /sdext | |
parent | cdf47ecc2cf090fe89d448ed96a568a03f2fbb07 (diff) |
pdf: refactor poppler importer
This paves the way to add pdf
parsing via pdfium.
Change-Id: I384687bcdce3011682ebeec18ee3de44759feb1a
Reviewed-on: https://gerrit.libreoffice.org/51254
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/69620
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/pdfimport/wrapper/wrapper.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index 08fd2e654146..86c64e4ea598 100644 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -1015,6 +1015,14 @@ public: } }; +bool xpdf_ImportFromFile_Poppler(const OUString& aSysUPath, + const ContentSinkSharedPtr& rSink, + const uno::Reference<task::XInteractionHandler>& xIHdl, + const bool bIsEncrypted, + const OUString& aPwd, + const uno::Reference<uno::XComponentContext>& xContext, + const OUString& rFilterOptions); + bool xpdf_ImportFromFile(const OUString& rURL, const ContentSinkSharedPtr& rSink, const uno::Reference<task::XInteractionHandler>& xIHdl, @@ -1045,6 +1053,19 @@ bool xpdf_ImportFromFile(const OUString& rURL, return false; } + return xpdf_ImportFromFile_Poppler(aSysUPath, rSink, xIHdl, bIsEncrypted, aPwd, xContext, rFilterOptions); +} + +/// Parse PDf file using libpoppler, which is quite limited +/// to be phased out in favor of pdfium. +bool xpdf_ImportFromFile_Poppler(const OUString& aSysUPath, + const ContentSinkSharedPtr& rSink, + const uno::Reference<task::XInteractionHandler>& /*xIHdl*/, + const bool bIsEncrypted, + const OUString& aPwd, + const uno::Reference<uno::XComponentContext>& xContext, + const OUString& rFilterOptions) +{ // Determine xpdfimport executable URL: OUString converterURL("$BRAND_BASE_DIR/" LIBO_BIN_FOLDER "/xpdfimport"); rtl::Bootstrap::expandMacros(converterURL); //TODO: detect failure |