Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit 74372d1

Browse files
committed
Fix build failure with Poppler ≥ 0.31.
1 parent b65e8db commit 74372d1

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

doc/changelog

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
pdf2djvu (0.7.19) UNRELEASED; urgency=low
22

3-
*
3+
* Fix build failure with Poppler ≥ 0.31.
4+
Thanks to David Evans for the bug report.
5+
https://code.google.com/p/pdf2djvu/issues/detail?id=99
46

5-
-- Jakub Wilk <[email protected]> Fri, 06 Feb 2015 12:06:22 +0100
7+
-- Jakub Wilk <[email protected]> Fri, 06 Feb 2015 12:39:06 +0100
68

79
pdf2djvu (0.7.18) unstable; urgency=low
810

pdf-backend.cc

+14
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,13 @@ pdf::Environment::Environment(const char *argv0)
126126

127127
void pdf::Environment::set_antialias(bool value)
128128
{
129+
this->antialias = value;
130+
#if POPPLER_VERSION < 3100
129131
if (!globalParams->setAntialias(const_cast<char*>(value ? "yes" : "no")))
130132
throw UnableToSetParameter(_("Unable to set antialias parameter"));
131133
if (!globalParams->setVectorAntialias(const_cast<char*>(value ? "yes" : "no")))
132134
throw UnableToSetParameter(_("Unable to set vector antialias parameter"));
135+
#endif
133136
}
134137

135138

@@ -454,6 +457,17 @@ void pdf::set_color(splash::Color &result, uint8_t r, uint8_t g, uint8_t b)
454457
* ===============================================
455458
*/
456459

460+
bool pdf::Environment::antialias = false;
461+
462+
pdf::Renderer::Renderer(pdf::splash::Color &paper_color, bool monochrome)
463+
: pdf::splash::OutputDevice(monochrome ? splashModeMono1 : splashModeRGB8, 4, false, paper_color)
464+
{
465+
#if POPPLER_VERSION >= 3100
466+
this->setFontAntialias(pdf::Environment::antialias);
467+
this->setVectorAntialias(pdf::Environment::antialias);
468+
#endif
469+
}
470+
457471
void pdf::Renderer::drawLink(pdf::link::Link *link, pdf::Catalog *catalog)
458472
{
459473
std::string border_color;

pdf-backend.hh

+2-3
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ namespace pdf
118118
class Renderer : public pdf::splash::OutputDevice
119119
{
120120
public:
121-
Renderer(pdf::splash::Color &paper_color, bool monochrome = false) :
122-
pdf::splash::OutputDevice(monochrome ? splashModeMono1 : splashModeRGB8, 4, false, paper_color)
123-
{ }
121+
Renderer(pdf::splash::Color &paper_color, bool monochrome = false);
124122

125123
#if POPPLER_VERSION < 1900
126124
void processLink(pdf::link::Link *link, pdf::Catalog *catalog)
@@ -301,6 +299,7 @@ namespace pdf
301299
{
302300
public:
303301
Environment(const char *argv0);
302+
static bool antialias;
304303
void set_antialias(bool value);
305304
class UnableToSetParameter : public std::runtime_error
306305
{

0 commit comments

Comments
 (0)