summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 36f18c3)
raw | patch | inline | side by side (parent: 36f18c3)
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Sun, 21 Mar 2010 01:53:59 +0000 (02:53 +0100) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Sun, 21 Mar 2010 01:53:59 +0000 (02:53 +0100) |
configure.ac | patch | blob | history | |
src/extension/internal/pdfinput/pdf-parser.cpp | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 330e40d7dd32ffb091ef91eae4331644d61de24f..d7c38a7c9d233177db54159b419597644d913a01 100644 (file)
--- a/configure.ac
+++ b/configure.ac
if test "x$poppler" = "xyes"; then
dnl Working libpoppler
- POPPLER_LIBS="-lpoppler "
dnl Have to test libpoppler-glib presence
PKG_CHECK_MODULES(POPPLER_GLIB, poppler-glib >= 0.5.9, poppler_glib=yes, poppler_glib=no)
if test "x$poppler_glib" = "xyes"; then
dnl Check whether the Cairo SVG backend is available
PKG_CHECK_MODULES(CAIRO_SVG, cairo-svg, cairo_svg=yes, cairo_svg=no)
if test "x$cairo_svg" = "xyes"; then
- POPPLER_LIBS="$POPPLER_LIBS -lpoppler-glib "
+ POPPLER_LIBS="$POPPLER_LIBS $POPPLER_GLIB_LIBS "
fi
fi
if test "x$enable_poppler_cairo" = "xyes"; then
if test "x$poppler_glib" = "xyes" -a "x$poppler_cairo" = "xyes" -a \
"x$cairo_svg" = "xno"
then
- POPPLER_LIBS="$POPPLER_LIBS -lpoppler-glib "
+ POPPLER_LIBS="$POPPLER_LIBS $POPPLER_CAIRO_LIBS "
fi
fi
fi
AC_SUBST(POPPLER_CFLAGS)
AC_SUBST(POPPLER_LIBS)
-PKG_CHECK_MODULES(POPPLERNEW, poppler >= 0.8.3, popplernew=yes, popplernew=no)
+PKG_CHECK_MODULES(POPPLER_GFXFONT, poppler >= 0.8.3, popplernew=yes, popplernew=no)
if test "x$popplernew" = "xyes"; then
- AC_DEFINE(POPPLER_NEW_GFXFONT, 1, [Poppler version of GfxFont to use (0.8.3 or higher versions of Poppler)])
+ AC_DEFINE(POPPLER_NEW_GFXFONT, 1, [Use GfxFont from Poppler >= 0.8.3])
+fi
+PKG_CHECK_MODULES(POPPLER_COLORSPACE, poppler >= 0.12.2, popplercolor=yes, popplercolor=no)
+if test "x$popplercolor" = "xyes"; then
+ AC_DEFINE(POPPLER_NEW_COLOR_SPACE_API, 1, [Use color space API from Poppler >= 0.12.2])
fi
dnl ******************************
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index 118896fd30318d74881f4d97a1a273ee592bc1ed..b37cbb7779ecb237c05e3a23576af3179cb77a3e 100644 (file)
blendingColorSpace = NULL;
isolated = knockout = gFalse;
if (!obj4.dictLookup(const_cast<char*>("CS"), &obj5)->isNull()) {
+#ifdef POPPLER_NEW_COLOR_SPACE_API
+ blendingColorSpace = GfxColorSpace::parse(&obj5, NULL);
+#else
blendingColorSpace = GfxColorSpace::parse(&obj5);
+#endif
}
obj5.free();
if (obj4.dictLookup(const_cast<char*>("I"), &obj5)->isBool()) {
state->setFillPattern(NULL);
res->lookupColorSpace(args[0].getName(), &obj);
+#ifdef POPPLER_NEW_COLOR_SPACE_API
+ if (obj.isNull()) {
+ colorSpace = GfxColorSpace::parse(&args[0], NULL);
+ } else {
+ colorSpace = GfxColorSpace::parse(&obj, NULL);
+ }
+#else
if (obj.isNull()) {
colorSpace = GfxColorSpace::parse(&args[0]);
} else {
colorSpace = GfxColorSpace::parse(&obj);
}
+#endif
obj.free();
if (colorSpace) {
state->setFillColorSpace(colorSpace);
state->setStrokePattern(NULL);
res->lookupColorSpace(args[0].getName(), &obj);
+#ifdef POPPLER_NEW_COLOR_SPACE_API
+ if (obj.isNull()) {
+ colorSpace = GfxColorSpace::parse(&args[0], NULL);
+ } else {
+ colorSpace = GfxColorSpace::parse(&obj, NULL);
+ }
+#else
if (obj.isNull()) {
colorSpace = GfxColorSpace::parse(&args[0]);
} else {
colorSpace = GfxColorSpace::parse(&obj);
}
+#endif
obj.free();
if (colorSpace) {
state->setStrokeColorSpace(colorSpace);
state->setFillColor(&color);
builder->updateStyle(state);
}
+#ifdef POPPLER_NEW_COLOR_SPACE_API
+ if (args[numArgs-1].isName() &&
+ (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) {
+ state->setFillPattern(pattern);
+ builder->updateStyle(state);
+ }
+#else
if (args[numArgs-1].isName() &&
(pattern = res->lookupPattern(args[numArgs-1].getName()))) {
state->setFillPattern(pattern);
builder->updateStyle(state);
}
+#endif
} else {
if (numArgs != state->getFillColorSpace()->getNComps()) {
state->setStrokeColor(&color);
builder->updateStyle(state);
}
+#ifdef POPPLER_NEW_COLOR_SPACE_API
+ if (args[numArgs-1].isName() &&
+ (pattern = res->lookupPattern(args[numArgs-1].getName(), NULL))) {
+ state->setStrokePattern(pattern);
+ builder->updateStyle(state);
+ }
+#else
if (args[numArgs-1].isName() &&
(pattern = res->lookupPattern(args[numArgs-1].getName()))) {
state->setStrokePattern(pattern);
builder->updateStyle(state);
}
+#endif
} else {
if (numArgs != state->getStrokeColorSpace()->getNComps()) {
double *matrix = NULL;
GBool savedState = gFalse;
+#ifdef POPPLER_NEW_COLOR_SPACE_API
+ if (!(shading = res->lookupShading(args[0].getName(), NULL))) {
+ return;
+ }
+#else
if (!(shading = res->lookupShading(args[0].getName()))) {
return;
}
+#endif
// save current graphics state
if (shading->getType() != 2 && shading->getType() != 3) {
}
}
if (!obj1.isNull()) {
+#ifdef POPPLER_NEW_COLOR_SPACE_API
+ colorSpace = GfxColorSpace::parse(&obj1, NULL);
+#else
colorSpace = GfxColorSpace::parse(&obj1);
+#endif
} else if (csMode == streamCSDeviceGray) {
colorSpace = new GfxDeviceGrayColorSpace();
} else if (csMode == streamCSDeviceRGB) {
obj2.free();
}
}
+#ifdef POPPLER_NEW_COLOR_SPACE_API
+ maskColorSpace = GfxColorSpace::parse(&obj1, NULL);
+#else
maskColorSpace = GfxColorSpace::parse(&obj1);
+#endif
obj1.free();
if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) {
goto err1;
if (obj1.dictLookup(const_cast<char*>("S"), &obj2)->isName(const_cast<char*>("Transparency"))) {
transpGroup = gTrue;
if (!obj1.dictLookup(const_cast<char*>("CS"), &obj3)->isNull()) {
+#ifdef POPPLER_NEW_COLOR_SPACE_API
+ blendingColorSpace = GfxColorSpace::parse(&obj3, NULL);
+#else
blendingColorSpace = GfxColorSpace::parse(&obj3);
+#endif
}
obj3.free();
if (obj1.dictLookup(const_cast<char*>("I"), &obj3)->isBool()) {