1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-21 12:40:08 +00:00

Merge pull request #33 from stephengaito/master

update pdf2htmlEX source to work with poppler-0.78.0
This commit is contained in:
stephengaito 2019-09-27 08:36:45 +01:00 committed by GitHub
commit 34bacbbff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 50 deletions

View File

@ -87,12 +87,12 @@
// CairoImage
//------------------------------------------------------------------------
CairoImage::CairoImage (double x1, double y1, double x2, double y2) {
this->image = nullptr;
this->x1 = x1;
this->y1 = y1;
this->x2 = x2;
this->y2 = y2;
CairoImage::CairoImage (double x1A, double y1A, double x2A, double y2A) {
image = nullptr;
x1 = x1A;
y1 = y1A;
x2 = x2A;
y2 = y2A;
}
CairoImage::~CairoImage () {
@ -100,10 +100,10 @@ CairoImage::~CairoImage () {
cairo_surface_destroy (image);
}
void CairoImage::setImage (cairo_surface_t *image) {
if (this->image)
cairo_surface_destroy (this->image);
this->image = cairo_surface_reference (image);
void CairoImage::setImage (cairo_surface_t *i) {
if (image)
cairo_surface_destroy (image);
image = cairo_surface_reference (i);
}
//------------------------------------------------------------------------
@ -161,7 +161,7 @@ CairoOutputDev::CairoOutputDev() {
cairo_shape = nullptr;
knockoutCount = 0;
text = nullptr;
textPage = nullptr;
actualText = nullptr;
// the SA parameter supposedly defaults to false, but Acrobat
@ -187,53 +187,53 @@ CairoOutputDev::~CairoOutputDev() {
cairo_pattern_destroy (mask);
if (shape)
cairo_pattern_destroy (shape);
if (text)
text->decRefCnt();
if (textPage)
textPage->decRefCnt();
if (actualText)
delete actualText;
}
void CairoOutputDev::setCairo(cairo_t *cairo)
void CairoOutputDev::setCairo(cairo_t *c)
{
if (this->cairo != nullptr) {
cairo_status_t status = cairo_status (this->cairo);
if (cairo != nullptr) {
cairo_status_t status = cairo_status (cairo);
if (status) {
error(errInternal, -1, "cairo context error: {0:s}\n", cairo_status_to_string(status));
}
cairo_destroy (this->cairo);
cairo_destroy (cairo);
assert(!cairo_shape);
}
if (cairo != nullptr) {
this->cairo = cairo_reference (cairo);
if (c != nullptr) {
cairo = cairo_reference (c);
/* save the initial matrix so that we can use it for type3 fonts. */
//XXX: is this sufficient? could we miss changes to the matrix somehow?
cairo_get_matrix(cairo, &orig_matrix);
setContextAntialias(cairo, antialias);
} else {
this->cairo = nullptr;
this->cairo_shape = nullptr;
cairo = nullptr;
cairo_shape = nullptr;
}
}
void CairoOutputDev::setTextPage(TextPage *text)
{
if (this->text)
this->text->decRefCnt();
if (textPage)
textPage->decRefCnt();
if (actualText)
delete actualText;
if (text) {
this->text = text;
this->text->incRefCnt();
textPage = text;
textPage->incRefCnt();
actualText = new ActualText(text);
} else {
this->text = nullptr;
textPage = nullptr;
actualText = nullptr;
}
}
void CairoOutputDev::setAntialias(cairo_antialias_t antialias)
void CairoOutputDev::setAntialias(cairo_antialias_t a)
{
this->antialias = antialias;
antialias = a;
if (cairo)
setContextAntialias (cairo, antialias);
if (cairo_shape)
@ -276,17 +276,17 @@ void CairoOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) {
stroke_pattern = cairo_pattern_reference(fill_pattern);
stroke_color.r = stroke_color.g = stroke_color.b = 0;
if (text)
text->startPage(state);
if (textPage)
textPage->startPage(state);
if (xrefA != nullptr) {
xref = xrefA;
}
}
void CairoOutputDev::endPage() {
if (text) {
text->endPage();
text->coalesce(true, 0, false);
if (textPage) {
textPage->endPage();
textPage->coalesce(true, 0, false);
}
}
@ -354,8 +354,8 @@ void CairoOutputDev::updateAll(GfxState *state) {
updateStrokeOpacity(state);
updateBlendMode(state);
needFontUpdate = true;
if (text)
text->updateFont(state);
if (textPage)
textPage->updateFont(state);
}
void CairoOutputDev::setDefaultCTM(const double *ctm) {
@ -659,8 +659,8 @@ void CairoOutputDev::updateFont(GfxState *state) {
needFontUpdate = false;
//FIXME: use cairo font engine?
if (text)
text->updateFont(state);
if (textPage)
textPage->updateFont(state);
currentFont = fontEngine->getFont (state->getFont(), doc, printing, xref);
@ -751,11 +751,11 @@ void CairoOutputDev::alignStrokeCoords(GfxSubpath *subpath, int i, double *x, do
#undef STROKE_COORD_TOLERANCE
void CairoOutputDev::doPath(cairo_t *cairo, GfxState *state, GfxPath *path) {
void CairoOutputDev::doPath(cairo_t *c, GfxState *state, GfxPath *path) {
GfxSubpath *subpath;
int i, j;
double x, y;
cairo_new_path (cairo);
cairo_new_path (c);
for (i = 0; i < path->getNumSubpaths(); ++i) {
subpath = path->getSubpath(i);
if (subpath->getNumPoints() > 0) {
@ -765,7 +765,7 @@ void CairoOutputDev::doPath(cairo_t *cairo, GfxState *state, GfxPath *path) {
x = subpath->getX(0);
y = subpath->getY(0);
}
cairo_move_to (cairo, x, y);
cairo_move_to (c, x, y);
j = 1;
while (j < subpath->getNumPoints()) {
if (subpath->getCurve(j)) {
@ -775,7 +775,7 @@ void CairoOutputDev::doPath(cairo_t *cairo, GfxState *state, GfxPath *path) {
x = subpath->getX(j+2);
y = subpath->getY(j+2);
}
cairo_curve_to( cairo,
cairo_curve_to( c,
subpath->getX(j), subpath->getY(j),
subpath->getX(j+1), subpath->getY(j+1),
x, y);
@ -788,13 +788,13 @@ void CairoOutputDev::doPath(cairo_t *cairo, GfxState *state, GfxPath *path) {
x = subpath->getX(j);
y = subpath->getY(j);
}
cairo_line_to (cairo, x, y);
cairo_line_to (c, x, y);
++j;
}
}
if (subpath->isClosed()) {
LOG (printf ("close\n"));
cairo_close_path (cairo);
cairo_close_path (c);
}
}
}
@ -1423,7 +1423,7 @@ void CairoOutputDev::drawChar(GfxState *state, double x, double y,
}
}
if (!text)
if (!textPage)
return;
actualText->addChar (state, x, y, dx, dy, code, nBytes, u, uLen);
}
@ -1580,13 +1580,13 @@ void CairoOutputDev::endTextObject(GfxState *state) {
void CairoOutputDev::beginActualText(GfxState *state, const GooString *text)
{
if (this->text)
if (textPage)
actualText->begin(state, text);
}
void CairoOutputDev::endActualText(GfxState *state)
{
if (text)
if (textPage)
actualText->end(state);
}

View File

@ -23,7 +23,7 @@
// Copyright (C) 2010-2013 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2015 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
// Copyright (C) 2016 Jason Crain <jason@aquaticape.us>
// Copyright (C) 2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2018, 2019 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
//
// To see a description of the changes please see the Changelog file that
@ -347,7 +347,7 @@ protected:
cairo_antialias_t antialias;
bool prescaleImages;
TextPage *text; // text for the current page
TextPage *textPage; // text for the current page
ActualText *actualText;
cairo_pattern_t *group;

View File

@ -10,7 +10,7 @@ option(ENABLE_SVG "Enable SVG support, for generating SVG background images and
include_directories(${CMAKE_SOURCE_DIR}/src)
set(PDF2HTMLEX_VERSION "0.18.3")
set(PDF2HTMLEX_VERSION "0.18.4")
set(ARCHIVE_NAME pdf2htmlex-${PDF2HTMLEX_VERSION})
add_custom_target(dist
COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD

View File

@ -8,7 +8,7 @@ This table lists the (recent) pdf2htmlEX releases which work for a given
| poppler-0.81.0 | unknown |
| poppler-0.80.0 | unknown |
| poppler-0.79.0 | unknown |
| poppler-0.78.0 | unknown |
| poppler-0.78.0 | v0.18.4-poppler-0.78.0 |
| poppler-0.77.0 | v0.18.3-poppler-0.77.0 |
| poppler-0.76.0 | v0.18.2-poppler-0.76.0 |
| poppler-0.75.0 | v0.18.1-poppler-0.75.0 |