Skip to content

Commit e57018e

Browse files
author
Otfried Cheong
committed
Pdftoipe now works with poppler 0.86. Added 'override' to all virtual functions in XmlOutputDev to catch such problems at compile time in the future.
1 parent 1e4c7ae commit e57018e

File tree

4 files changed

+31
-34
lines changed

4 files changed

+31
-34
lines changed

pdftoipe/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ else
2323
TARGET = pdftoipe
2424
endif
2525

26-
CXXFLAGS += -Wno-write-strings -std=c++14
26+
CXXFLAGS += -Wno-write-strings -std=c++17
2727

2828
all: $(TARGET)
2929

pdftoipe/readme.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ the mailing list, where anyone interested can participate than by
2828
direct Email.
2929

3030
Otfried Cheong
31-
Dept. of Computer Science
31+
School of Computing
3232
KAIST
3333
Daejeon, South Korea
3434
Email: ipe@otfried.org
@@ -46,7 +46,7 @@ option) any later version.
4646
Compiling
4747
=========
4848

49-
You need the Poppler library (http://poppler.freedesktop.org) v0.83.0
49+
You need the Poppler library (http://poppler.freedesktop.org) v0.86.0
5050
or greater. On Debian/Ubuntu, install the packages 'libpoppler-dev'
5151
and 'libpoppler-private-dev'.
5252

@@ -63,18 +63,22 @@ releases, as the developers are updating the code to use modern C++.
6363

6464
If your poppler version is <= v0.68, then you can check out branch
6565
"old-poppler" from the "ipe-tools" repository. If you have a version
66-
between v0.69 and v0.82 and cannot upgrade poppler easily, you need to
66+
between v0.69 and v0.85 and cannot upgrade poppler easily, you need to
6767
look in the release history below and checkout the right release of
6868
the "ipe-tools" repository.
6969

7070
If you want to compile pdftoipe on Windows, please refer to
71-
"compile_on_windows.pdf", written by Daniel Beckmann.
71+
"compile_on_windows.pdf", written by Daniel Beckmann. I have not been
72+
able to get this to work myself for recent versions of poppler.
7273

7374
--------------------------------------------------------------------
7475

7576
Changes
7677
=======
7778

79+
* 2020/09/09 (v7.2.20.1)
80+
Compatibility with poppler 0.86.0 (#47).
81+
7882
* 2019/12/10 (v7.2.13.1)
7983
Compilation with poppler 0.83.0 (#42).
8084

@@ -86,7 +90,7 @@ Changes
8690
std::string and may be getting deprecated soon so get rid of some
8791
uses.
8892

89-
* 2018/11/01
93+
* 2018/11/01
9094
Poppler keeps changing: gBool -> bool (issue #31).
9195

9296
* 2018/10/23
@@ -161,8 +165,7 @@ Changes
161165
Packaged pdftoipe separately from Ipe.
162166

163167
* 2003/06/04
164-
Fixed handling of transformation matrix in Pdftoipe. Pdftoipe
165-
is now actually considered supported.
168+
Fixed handling of transformation matrix in Pdftoipe.
166169

167170
Added option -math to pdftoipe. With this option, all text objects
168171
are turned into math formulas.

pdftoipe/xmloutputdev.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,6 @@ void XmlOutputDev::setTextHandling(bool math, bool notext,
118118

119119
// ----------------------------------------------------------
120120

121-
void XmlOutputDev::startPage(int pageNum, GfxState *state)
122-
{
123-
startPage(pageNum, state, NULL); // for poppler <= 0.22
124-
}
125-
126121
void XmlOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA)
127122
{
128123
writePSFmt("<!-- Page: %d %d -->\n", pageNum, seqPage);
@@ -248,7 +243,7 @@ void XmlOutputDev::drawChar(GfxState *state, double x, double y,
248243
double dx, double dy,
249244
double originX, double originY,
250245
CharCode code, int nBytes,
251-
Unicode *u, int uLen)
246+
const Unicode *u, int uLen)
252247
{
253248
// check for invisible text -- this is used by Acrobat Capture
254249
if ((state->getRender() & 3) == 3)
@@ -326,7 +321,7 @@ void XmlOutputDev::finishText()
326321

327322
void XmlOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
328323
int width, int height, GfxImageColorMap *colorMap,
329-
bool interpolate, int *maskColors,
324+
bool interpolate, const int *maskColors,
330325
bool inlineImg)
331326
{
332327
finishText();

pdftoipe/xmloutputdev.h

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class GfxPath;
1515
class GfxFont;
1616

17-
#define PDFTOIPE_VERSION "2019/12/10"
17+
#define PDFTOIPE_VERSION "2020/09/09"
1818

1919
class XmlOutputDev : public OutputDev
2020
{
@@ -28,7 +28,7 @@ class XmlOutputDev : public OutputDev
2828
virtual ~XmlOutputDev();
2929

3030
// Check if file was successfully created.
31-
virtual bool isOk() { return ok; }
31+
bool isOk() { return ok; }
3232

3333
bool hasUnicode() const { return iUnicode; }
3434

@@ -39,49 +39,48 @@ class XmlOutputDev : public OutputDev
3939

4040
// Does this device use upside-down coordinates?
4141
// (Upside-down means (0,0) is the top left corner of the page.)
42-
virtual bool upsideDown() { return false; }
42+
virtual bool upsideDown() override { return false; }
4343

4444
// Does this device use drawChar() or drawString()?
45-
virtual bool useDrawChar() { return true; }
45+
virtual bool useDrawChar() override { return true; }
4646

4747
// Does this device use beginType3Char/endType3Char? Otherwise,
4848
// text in Type 3 fonts will be drawn with drawChar/drawString.
49-
virtual bool interpretType3Chars() { return false; }
49+
virtual bool interpretType3Chars() override { return false; }
5050

5151
//----- initialization and control
5252

5353
// Start a page.
54-
virtual void startPage(int pageNum, GfxState *state); // poppler <=0.22
55-
virtual void startPage(int pageNum, GfxState *state, XRef *xrefA);
54+
virtual void startPage(int pageNum, GfxState *state, XRef *xrefA) override;
5655

5756
// End a page.
58-
virtual void endPage();
57+
virtual void endPage() override;
5958

6059
//----- update graphics state
61-
virtual void updateTextPos(GfxState *state);
62-
virtual void updateTextShift(GfxState *state, double shift);
60+
virtual void updateTextPos(GfxState *state) override;
61+
virtual void updateTextShift(GfxState *state, double shift) override;
6362

6463
//----- path painting
65-
virtual void stroke(GfxState *state);
66-
virtual void fill(GfxState *state);
67-
virtual void eoFill(GfxState *state);
64+
virtual void stroke(GfxState *state) override;
65+
virtual void fill(GfxState *state) override;
66+
virtual void eoFill(GfxState *state) override;
6867

6968
//----- text drawing
7069
virtual void drawChar(GfxState *state, double x, double y,
7170
double dx, double dy,
7271
double originX, double originY,
73-
CharCode code, int nBytes, Unicode *u, int uLen);
72+
CharCode code, int nBytes, const Unicode *u, int uLen) override;
7473

7574
//----- image drawing
7675
virtual void drawImage(GfxState *state, Object *ref, Stream *str,
7776
int width, int height, GfxImageColorMap *colorMap,
78-
bool interpolate, int *maskColors, bool inlineImg);
77+
bool interpolate, const int *maskColors, bool inlineImg) override;
7978

8079
protected:
81-
virtual void startDrawingPath();
82-
virtual void startText(GfxState *state, double x, double y);
83-
virtual void finishText();
84-
virtual void writePSUnicode(int ch);
80+
void startDrawingPath();
81+
void startText(GfxState *state, double x, double y);
82+
void finishText();
83+
void writePSUnicode(int ch);
8584

8685
void doPath(GfxState *state);
8786
void writePSChar(int code);

0 commit comments

Comments
 (0)