Tuesday, March 10, 2020

fix print/scribus with poppler-0.86

Hi,

this fixes the build of print/scribus against puppler-0.86. Ugly,
but what can I do (it's what I found in upstreams svn repository)?

Survived a build on amd64, and i also successfully imported a PDF
(as image) and exported the result back to PDF.

If i don't get any complaints, i'll just put this in in a day or two,
together with the poppler update.

Ciao,
Kili

Index: patches/patch-scribus_plugins_import_pdf_importpdf_cpp
===================================================================
RCS file: /cvs/ports/print/scribus/patches/patch-scribus_plugins_import_pdf_importpdf_cpp,v
retrieving revision 1.1
diff -u -p -r1.1 patch-scribus_plugins_import_pdf_importpdf_cpp
--- patches/patch-scribus_plugins_import_pdf_importpdf_cpp 19 Feb 2020 12:15:45 -0000 1.1
+++ patches/patch-scribus_plugins_import_pdf_importpdf_cpp 10 Mar 2020 22:12:35 -0000
@@ -2,6 +2,8 @@ $OpenBSD: patch-scribus_plugins_import_p

Fix build with newer poppler, from archlinux

+Fix for poppler-0.86.x from svn r23478.
+
Index: scribus/plugins/import/pdf/importpdf.cpp
--- scribus/plugins/import/pdf/importpdf.cpp.orig
+++ scribus/plugins/import/pdf/importpdf.cpp
@@ -75,7 +77,29 @@ Index: scribus/plugins/import/pdf/import
return false;
}
pageString = optImp->getPagesString();
-@@ -908,8 +926,12 @@ bool PdfPlug::convert(const QString& fn)
+@@ -838,11 +856,20 @@ bool PdfPlug::convert(const QString& fn)
+ names = catDict.dictLookup("OpenAction");
+ if (names.isDict())
+ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkAction> linkAction;
++ linkAction = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
++#else
+ LinkAction *linkAction = nullptr;
+ linkAction = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
++

No comments:

Post a Comment