Commit 93ccf031 authored by David Tardon's avatar David Tardon Committed by Tim Sheridan

adapt to poppler 0.58

parent da1a3973
Pipeline #11700293 passed with stage
......@@ -124,6 +124,10 @@ if(ENABLE_POPPLER)
POPPLER_VERSION VERSION_EQUAL "0.29.0")
set(POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API ON)
endif()
if(POPPLER_VERSION VERSION_GREATER "0.58.0" OR
POPPLER_VERSION VERSION_EQUAL "0.58.0")
set(POPPLER_NEW_OBJECT_API ON)
endif()
else()
set(ENABLE_POPPLER_CAIRO OFF)
endif()
......
......@@ -149,6 +149,9 @@
/* Use color space API from Poppler >= 0.29.0 */
#cmakedefine POPPLER_EVEN_NEWER_NEW_COLOR_SPACE_API 1
/* Use object API from Poppler >= 0.58.0 */
#cmakedefine POPPLER_NEW_OBJECT_API 1
/* Define to 1 if you have the `pow' function. */
#cmakedefine HAVE_POW 1
......
......@@ -840,14 +840,20 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
}
// Parse the document structure
#if defined(POPPLER_NEW_OBJECT_API)
Object obj = page->getContents();
#else
Object obj;
page->getContents(&obj);
#endif
if (!obj.isNull()) {
pdf_parser->parse(&obj);
}
// Cleanup
#if !defined(POPPLER_NEW_OBJECT_API)
obj.free();
#endif
delete pdf_parser;
delete builder;
g_free(docname);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment