From cc895651302dc42dfb91ef06c41872d9dae8dd44 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 4 Apr 2024 09:41:50 +0500 Subject: [PATCH] Related: tdf#160260 Drop xpdfimport.err.pdf, let PDF import return false The problem was, that upon any error in opening a PDF, out Poppler wrapper used another bundled document, with a single page with a static text "This PDF file is encrypted and can't be opened.". That happened regardless of the nature of the problem (it could be an IO problem, as in tdf#160260, or other things from Poppler's poppler/ErrorCodes.h). For automated import (command line or API), it meant that it was not possible to detect the failure. This replaces this strange mechanism with a normal error reporting. For now, a simple "general input/output error" will be reported; but it is possible to use interaction handler to show details (see comment in xpdf_ImportFromFile). Change-Id: I30493118fc5dd0b1c62cae7718acfe95bb4b13b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165771 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sdext/Package_pdfimport_xpdfimport.mk | 2 -- .../pdfimport/dialogs/xpdfimport_err.pdf | Bin 21204 -> 0 bytes sdext/source/pdfimport/wrapper/wrapper.cxx | 17 +++----------- .../pdfimport/xpdfwrapper/wrapper_gpl.cxx | 21 +++++------------- 4 files changed, 9 insertions(+), 31 deletions(-) delete mode 100644 sdext/source/pdfimport/dialogs/xpdfimport_err.pdf diff --git a/sdext/Package_pdfimport_xpdfimport.mk b/sdext/Package_pdfimport_xpdfimport.mk index 9f08e05f4773..c1c82814aa77 100644 --- a/sdext/Package_pdfimport_xpdfimport.mk +++ b/sdext/Package_pdfimport_xpdfimport.mk @@ -9,6 +9,4 @@ $(eval $(call gb_Package_Package,sdext_pdfimport_pdf,$(SRCDIR)/sdext)) -$(eval $(call gb_Package_add_file,sdext_pdfimport_pdf,$(LIBO_SHARE_FOLDER)/xpdfimport/xpdfimport_err.pdf,source/pdfimport/dialogs/xpdfimport_err.pdf)) - # vim: set noet sw=4 ts=4: diff --git a/sdext/source/pdfimport/dialogs/xpdfimport_err.pdf b/sdext/source/pdfimport/dialogs/xpdfimport_err.pdf deleted file mode 100644 index d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sVFWCAdux;r$nHg^&~5P6 zR2)E}5s4HWiA1oWf+8%<8bh`L01NnkSAoE8%?qTnS%G1ZQQ;^wK%fx_))*QAV?!q5 m$#gmq^bg)hL>n@dOeH~(jTA8Xg1IflLdb;c>Df3l;Qs?%L26k5 diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index d99103b9867a..6a17d295eae1 100644 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -1079,24 +1079,12 @@ bool xpdf_ImportFromFile(const OUString& rURL, OUString converterURL("$BRAND_BASE_DIR/" LIBO_BIN_FOLDER "/xpdfimport"); rtl::Bootstrap::expandMacros(converterURL); //TODO: detect failure - // Determine pathname of xpdfimport_err.pdf: - OUString errPathname("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/xpdfimport/xpdfimport_err.pdf"); - rtl::Bootstrap::expandMacros(errPathname); //TODO: detect failure - if (osl::FileBase::getSystemPathFromFileURL(errPathname, errPathname) - != osl::FileBase::E_None) - { - SAL_WARN( - "sdext.pdfimport", - "getSystemPathFromFileURL(" << errPathname << ") failed"); - return false; - } - // spawn separate process to keep LGPL/GPL code apart. OUString aOptFlag("-o"); - rtl_uString* args[] = { aSysUPath.pData, errPathname.pData, + rtl_uString* args[] = { aSysUPath.pData, aOptFlag.pData, rFilterOptions.pData }; - sal_Int32 nArgs = rFilterOptions.isEmpty() ? 2 : 4; + sal_Int32 nArgs = rFilterOptions.isEmpty() ? std::size(args) - 2 : std::size(args); oslProcess aProcess; oslFileHandle pIn = nullptr; @@ -1206,6 +1194,7 @@ bool xpdf_ImportFromFile(const OUString& rURL, "sdext.pdfimport", "getProcessInfo of " << converterURL << " failed with exit code " << info.Code); + // TODO: use xIHdl and/or exceptions to inform the user; see poppler/ErrorCodes.h bRet = false; } } diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx index 383f6810b2a2..ebed120708cc 100644 --- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx @@ -152,7 +152,6 @@ int main(int argc, char **argv) // PDFDoc takes over ownership for all strings below GooString* pFileName = new GooString(myStringToStdString(argv[1])); - GooString* pErrFileName = new GooString(myStringToStdString(argv[2])); // check for password string(s) GooString* pOwnerPasswordStr( aPwBuf[0] != 0 @@ -182,30 +181,22 @@ int main(int argc, char **argv) PDFDoc aDoc( std::make_unique(pFileName), std::optional(pOwnerPasswordStr), std::optional(pUserPasswordStr) ); - - PDFDoc aErrDoc( std::make_unique(pErrFileName), - std::optional(pOwnerPasswordStr), - std::optional(pUserPasswordStr) ); #else PDFDoc aDoc( pFileName, pOwnerPasswordStr, pUserPasswordStr ); - - PDFDoc aErrDoc( pErrFileName, - pOwnerPasswordStr, - pUserPasswordStr ); #endif - // Check various permissions for aDoc. - PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc; + if (!aDoc.isOk()) + return aDoc.getErrorCode(); - pdfi::PDFOutDev aOutDev(&rDoc); + pdfi::PDFOutDev aOutDev(&aDoc); if (options == TO_STRING_VIEW("SkipImages")) { aOutDev.setSkipImages(true); } // tell the receiver early - needed for proper progress calculation - const int nPages = rDoc.isOk()? rDoc.getNumPages(): 0; + const int nPages = aDoc.getNumPages(); pdfi::PDFOutDev::setPageNum(nPages); // virtual resolution of the PDF OutputDev in dpi @@ -214,12 +205,12 @@ int main(int argc, char **argv) // do the conversion for (int i = 1; i <= nPages; ++i) { - rDoc.displayPage(&aOutDev, + aDoc.displayPage(&aOutDev, i, PDFI_OUTDEV_RESOLUTION, PDFI_OUTDEV_RESOLUTION, 0, true, true, true); - rDoc.processLinks(&aOutDev, i); + aDoc.processLinks(&aOutDev, i); } return 0;