Compare commits

...

No commits in common. 'c9' and 'i10cs' have entirely different histories.
c9 ... i10cs

4
.gitignore vendored

@ -1,2 +1,2 @@
SOURCES/poppler-21.01.0.tar.xz
SOURCES/poppler-test-2021-06-14.tar.xz
SOURCES/poppler-24.02.0.tar.xz
SOURCES/poppler-test-2021-01-11-03a4b9eb854a06a83c465e82de601796c458bbe9.tar.xz

@ -1,2 +1,2 @@
692697b218efd08ebaeb4ff96861a4d2ad20bdc2 SOURCES/poppler-21.01.0.tar.xz
bd4b27622506278016668f7c5037f9e47a41abfb SOURCES/poppler-test-2021-06-14.tar.xz
c1d39286dc67245274c9ab698cb910ed2aff18d8 SOURCES/poppler-24.02.0.tar.xz
4f8e2304626c0229e2f5f02a39d6e6b93620326b SOURCES/poppler-test-2021-01-11-03a4b9eb854a06a83c465e82de601796c458bbe9.tar.xz

@ -1,279 +0,0 @@
From 0ab1f29d4ce315b0fca260c0e0f3007024d00342 Mon Sep 17 00:00:00 2001
From: Marek Kasik <mkasik@redhat.com>
Date: Tue, 28 Jan 2014 15:13:24 +0100
Subject: [PATCH] TextOutputDev: Respect orientation when selecting words
Take rotation into account when visiting selection.
This doesn't fix all problems (there are still problems
on line and block levels).
https://bugs.freedesktop.org/show_bug.cgi?id=16619
---
poppler/TextOutputDev.cc | 193 ++++++++++++++++++++++++++++++++++++-----------
1 file changed, 150 insertions(+), 43 deletions(-)
diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index 7c2ca78..e93908c 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -178,6 +178,12 @@
// to read the underlying image. Issue #157
#define glyphlessSelectionOpacity 0.4
+// Returns whether x is between a and b or equal to a or b.
+// a and b don't need to be sorted.
+#define XBetweenAB(x,a,b) (!(((x) > (a) && (x) > (b)) || \
+ ((x) < (a) && (x) < (b))) ? \
+ true : false)
+
namespace {
inline bool isAscii7(Unicode uchar)
@@ -4411,11 +4417,37 @@ void TextSelectionSizer::visitLine (TextLine *line,
PDFRectangle *rect;
double x1, y1, x2, y2, margin;
- margin = (line->yMax - line->yMin) / 8;
- x1 = line->edge[edge_begin];
- y1 = line->yMin - margin;
- x2 = line->edge[edge_end];
- y2 = line->yMax + margin;
+ switch (line->rot) {
+ default:
+ case 0:
+ margin = (line->yMax - line->yMin) / 8;
+ x1 = line->edge[edge_begin];
+ x2 = line->edge[edge_end];
+ y1 = line->yMin - margin;
+ y2 = line->yMax + margin;
+ break;
+ case 1:
+ margin = (line->xMax - line->xMin) / 8;
+ x1 = line->xMin - margin;
+ x2 = line->xMax + margin;
+ y1 = line->edge[edge_begin];
+ y2 = line->edge[edge_end];
+ break;
+ case 2:
+ margin = (line->yMax - line->yMin) / 8;
+ x1 = line->edge[edge_end];
+ x2 = line->edge[edge_begin];
+ y1 = line->yMin - margin;
+ y2 = line->yMax + margin;
+ break;
+ case 3:
+ margin = (line->xMax - line->xMin) / 8;
+ x1 = line->xMin - margin;
+ x2 = line->xMax + margin;
+ y1 = line->edge[edge_end];
+ y2 = line->edge[edge_begin];
+ break;
+ }
rect = new PDFRectangle(floor(x1 * scale), floor(y1 * scale), ceil(x2 * scale), ceil(y2 * scale));
list->push_back(rect);
@@ -4499,19 +4531,56 @@ void TextSelectionPainter::visitLine (TextLine *line,
{
double x1, y1, x2, y2, margin;
- margin = (line->yMax - line->yMin) / 8;
- x1 = floor(line->edge[edge_begin]);
- y1 = floor(line->yMin - margin);
- x2 = ceil(line->edge[edge_end]);
- y2 = ceil(line->yMax + margin);
+ switch (line->rot) {
+ default:
+ case 0:
+ margin = (line->yMax - line->yMin) / 8;
+ x1 = line->edge[edge_begin];
+ x2 = line->edge[edge_end];
+ y1 = line->yMin - margin;
+ y2 = line->yMax + margin;
+ break;
+ case 1:
+ margin = (line->xMax - line->xMin) / 8;
+ x1 = line->xMin - margin;
+ x2 = line->xMax + margin;
+ y1 = line->edge[edge_begin];
+ y2 = line->edge[edge_end];
+ break;
+ case 2:
+ margin = (line->yMax - line->yMin) / 8;
+ x1 = line->edge[edge_end];
+ x2 = line->edge[edge_begin];
+ y1 = line->yMin - margin;
+ y2 = line->yMax + margin;
+ break;
+ case 3:
+ margin = (line->xMax - line->xMin) / 8;
+ x1 = line->xMin - margin;
+ x2 = line->xMax + margin;
+ y1 = line->edge[edge_end];
+ y2 = line->edge[edge_begin];
+ break;
+ }
+
+ ctm.transform(x1, y1, &x1, &y1);
+ ctm.transform(x2, y2, &x2, &y2);
- ctm.transform(line->edge[edge_begin], line->yMin - margin, &x1, &y1);
- ctm.transform(line->edge[edge_end], line->yMax + margin, &x2, &y2);
+ if (x1 < x2) {
+ x1 = floor(x1);
+ x2 = ceil(x2);
+ } else {
+ x1 = ceil(x1);
+ x2 = floor(x2);
+ }
- x1 = floor(x1);
- y1 = floor(y1);
- x2 = ceil(x2);
- y2 = ceil(y2);
+ if (y1 < y2) {
+ y1 = floor(y1);
+ y2 = ceil(y2);
+ } else {
+ y1 = ceil(y1);
+ y2 = floor(y2);
+ }
ictm.transform(x1, y1, &x1, &y1);
ictm.transform(x2, y2, &x2, &y2);
@@ -4589,17 +4658,26 @@ void TextWord::visitSelection(TextSelectionVisitor *visitor,
void TextWord::visitSelection(TextSelectionVisitor *visitor, const PDFRectangle *selection, SelectionStyle style)
{
int i, begin, end;
- double mid;
+ double mid, s1, s2;
+
+ if (rot == 0 || rot == 2) {
+ s1 = selection->x1;
+ s2 = selection->x2;
+ } else {
+ s1 = selection->y1;
+ s2 = selection->y2;
+ }
begin = len;
end = 0;
for (i = 0; i < len; i++) {
mid = (edge[i] + edge[i + 1]) / 2;
- if (selection->x1 < mid || selection->x2 < mid)
- if (i < begin)
- begin = i;
- if (mid < selection->x1 || mid < selection->x2)
- end = i + 1;
+ if (XBetweenAB (mid, s1, s2)) {
+ if (i < begin)
+ begin = i;
+
+ end = i + 1;
+ }
}
/* Skip empty selection. */
@@ -4615,26 +4694,41 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor,
TextWord *p, *begin, *end, *current;
int i, edge_begin, edge_end;
PDFRectangle child_selection;
+ double s1, s2, p_min, p_max;
+
+ if (rot == 0 || rot == 2) {
+ s1 = selection->x1;
+ s2 = selection->x2;
+ } else {
+ s1 = selection->y1;
+ s2 = selection->y2;
+ }
begin = nullptr;
end = nullptr;
current = nullptr;
for (p = words; p != nullptr; p = p->next) {
+ if (rot == 0 || rot == 2) {
+ p_min = p->xMin;
+ p_max = p->xMax;
+ } else {
+ p_min = p->yMin;
+ p_max = p->yMax;
+ }
+
if (blk->page->primaryLR) {
- if ((selection->x1 < p->xMax) || (selection->x2 < p->xMax))
- if (begin == nullptr)
- begin = p;
+ if (((s1 < p_max) || (s2 < p_max)) && begin == nullptr)
+ begin = p;
- if (((selection->x1 > p->xMin) || (selection->x2 > p->xMin)) && (begin != nullptr)) {
+ if (((s1 > p_min) || (s2 > p_min)) && begin != nullptr) {
end = p->next;
current = p;
}
} else {
- if ((selection->x1 > p->xMin) || (selection->x2 > p->xMin))
- if (begin == nullptr)
- begin = p;
+ if (((s1 > p_min) || (s2 > p_min)) && begin == nullptr)
+ begin = p;
- if (((selection->x1 < p->xMax) || (selection->x2 < p->xMax)) && (begin != nullptr)) {
+ if (((s1 < p_max) || (s2 < p_max)) && begin != nullptr) {
end = p->next;
current = p;
}
@@ -4650,23 +4740,41 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor,
child_selection = *selection;
if (style == selectionStyleWord) {
- child_selection.x1 = begin ? begin->xMin : xMin;
- if (end && end->xMax != -1) {
- child_selection.x2 = current->xMax;
+ if (rot == 0 || rot == 2) {
+ child_selection.x1 = begin ? begin->xMin : xMin;
+ if (end && end->xMax != -1) {
+ child_selection.x2 = current->xMax;
+ } else {
+ child_selection.x2 = xMax;
+ }
} else {
- child_selection.x2 = xMax;
+ child_selection.y1 = begin ? begin->yMin : yMin;
+ if (end && end->yMax != -1) {
+ child_selection.y2 = current->yMax;
+ } else {
+ child_selection.y2 = yMax;
+ }
}
}
+ if (rot == 0 || rot == 2) {
+ s1 = child_selection.x1;
+ s2 = child_selection.x2;
+ } else {
+ s1 = child_selection.y1;
+ s2 = child_selection.y2;
+ }
+
edge_begin = len;
edge_end = 0;
for (i = 0; i < len; i++) {
double mid = (edge[i] + edge[i + 1]) / 2;
- if (child_selection.x1 < mid || child_selection.x2 < mid)
- if (i < edge_begin)
- edge_begin = i;
- if (mid < child_selection.x2 || mid < child_selection.x1)
- edge_end = i + 1;
+ if (XBetweenAB (mid, s1, s2)) {
+ if (i < edge_begin)
+ edge_begin = i;
+
+ edge_end = i + 1;
+ }
}
/* Skip empty selection. */
--
1.8.4.2

@ -1,9 +1,9 @@
--- poppler-0.90.0/CMakeLists.txt
+++ poppler-0.90.0/CMakeLists.txt
@@ -17,6 +17,9 @@ else()
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads)
endif()
include(MacroOptionalFindPackage)
find_package(PkgConfig)
+
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+

@ -1,21 +0,0 @@
From dcd5bd8238ea448addd102ff045badd0aca1b990 Mon Sep 17 00:00:00 2001
From: crt <chluo@cse.cuhk.edu.hk>
Date: Wed, 27 Jul 2022 08:40:02 +0000
Subject: pdfseparate: Check XRef's Catalog for being a Dict
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 351140af..c26a41c4 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -886,6 +886,10 @@ int PDFDoc::savePageAs(const GooString &name, int pageNo)
// get and mark output intents etc.
Object catObj = getXRef()->getCatalog();
+ if (!catObj.isDict()) {
+ error(errSyntaxError, -1, "XRef's Catelog is not a dictionary");
+ return errOpenFile;
+ }
Dict *catDict = catObj.getDict();
Object pagesObj = catDict->lookup("Pages");
Object afObj = catDict->lookupNF("AcroForm").copy();

@ -1,34 +0,0 @@
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -1757,6 +1757,9 @@ void PDFDoc::replacePageDict(int pageNo,
{
Ref *refPage = getCatalog()->getPageRef(pageNo);
Object page = getXRef()->fetch(*refPage);
+ if (!page.isDict()) {
+ return;
+ }
Dict *pageDict = page.getDict();
pageDict->remove("MediaBoxssdf");
pageDict->remove("MediaBox");
--- a/utils/pdfunite.cc
+++ b/utils/pdfunite.cc
@@ -293,9 +293,18 @@ int main(int argc, char *argv[])
const PDFRectangle *cropBox = nullptr;
if (docs[i]->getCatalog()->getPage(j)->isCropped())
cropBox = docs[i]->getCatalog()->getPage(j)->getCropBox();
- docs[i]->replacePageDict(j, docs[i]->getCatalog()->getPage(j)->getRotate(), docs[i]->getCatalog()->getPage(j)->getMediaBox(), cropBox);
Ref *refPage = docs[i]->getCatalog()->getPageRef(j);
Object page = docs[i]->getXRef()->fetch(*refPage);
+ if (!page.isDict()) {
+ fclose(f);
+ delete yRef;
+ delete countRef;
+ delete outStr;
+ error(errSyntaxError, -1, "PDFDoc::replacePageDict failed.");
+ return -1;
+ } else {
+ docs[i]->replacePageDict(j, docs[i]->getCatalog()->getPage(j)->getRotate(), docs[i]->getCatalog()->getPage(j)->getMediaBox(), cropBox);
+ }
Dict *pageDict = page.getDict();
Object *resDict = docs[i]->getCatalog()->getPage(j)->getResourceDictObject();
if (resDict->isDict()) {

@ -1,439 +0,0 @@
--- poppler/glib/poppler-document.cc
+++ poppler/glib/poppler-document.cc
@@ -869,12 +869,12 @@ GTree *poppler_document_create_dests_tre
// Iterate from name-dict
const int nDests = catalog->numDests();
for (i = 0; i < nDests; ++i) {
- // The names of name-dict cannot contain \0,
- // so we can use strlen().
- auto name = catalog->getDestsName(i);
- key = poppler_named_dest_from_bytestring(reinterpret_cast<const guint8 *>(name), strlen(name));
std::unique_ptr<LinkDest> link_dest = catalog->getDestsDest(i);
if (link_dest) {
+ // The names of name-dict cannot contain \0,
+ // so we can use strlen().
+ auto name = catalog->getDestsName(i);
+ key = poppler_named_dest_from_bytestring(reinterpret_cast<const guint8 *>(name), strlen(name));
dest = _poppler_dest_new_goto(document, link_dest.get());
g_tree_insert(tree, key, dest);
}
@@ -883,10 +883,10 @@ GTree *poppler_document_create_dests_tre
// Iterate form name-tree
const int nDestsNameTree = catalog->numDestNameTree();
for (i = 0; i < nDestsNameTree; ++i) {
- auto name = catalog->getDestNameTreeName(i);
- key = poppler_named_dest_from_bytestring(reinterpret_cast<const guint8 *>(name->c_str()), name->getLength());
std::unique_ptr<LinkDest> link_dest = catalog->getDestNameTreeDest(i);
if (link_dest) {
+ auto name = catalog->getDestNameTreeName(i);
+ key = poppler_named_dest_from_bytestring(reinterpret_cast<const guint8 *>(name->c_str()), name->getLength());
dest = _poppler_dest_new_goto(document, link_dest.get());
g_tree_insert(tree, key, dest);
}
@@ -3405,6 +3405,7 @@ PopplerFormField *poppler_document_get_f
unsigned fieldNum;
FormPageWidgets *widgets;
FormWidget *field;
+ PopplerFormField *formField;
FormWidget::decodeID(id, &pageNum, &fieldNum);
@@ -3417,8 +3418,14 @@ PopplerFormField *poppler_document_get_f
return nullptr;
field = widgets->getWidget(fieldNum);
- if (field)
- return _poppler_form_field_new(document, field);
+ if (field) {
+ formField = _poppler_form_field_new(document, field);
+ delete widgets;
+
+ return formField;
+ }
+
+ delete widgets;
return nullptr;
}
--- poppler-21.01.0/glib/poppler-page.cc
+++ poppler-21.01.0/glib/poppler-page.cc
@@ -1530,15 +1530,18 @@ void poppler_page_add_annot(PopplerPage
* first remove cropbox of the prior page before adding cropbox of the new page later */
quads = new_quads_from_offset_cropbox(crop_box, annot_markup->getQuadrilaterals(), FALSE);
annot_markup->setQuadrilaterals(quads);
+ delete quads;
}
if (page_is_rotated) {
/* Quadrilateral's coords need to be saved un-rotated (same as rect coords) */
quads = _page_new_quads_unrotated(page->page, annot_markup->getQuadrilaterals());
annot_markup->setQuadrilaterals(quads);
+ delete quads;
}
/* Add to annot's quadrilaterals the offset for the cropbox of the new page */
quads = new_quads_from_offset_cropbox(page_crop_box, annot_markup->getQuadrilaterals(), TRUE);
annot_markup->setQuadrilaterals(quads);
+ delete quads;
}
page->page->addAnnot(annot->annot);
--- poppler-21.01.0/glib/poppler-structure-element.cc
+++ poppler-21.01.0/glib/poppler-structure-element.cc
@@ -1090,6 +1090,8 @@ static inline void convert_doubles_array
for (guint i = 0; i < *n_values; i++) {
doubles[i] = object->arrayGet(i).getNum();
}
+
+ values = &doubles;
}
static inline void convert_color(Object *object, PopplerColor *color)
--- poppler-21.01.0/poppler/Form.cc
+++ poppler-21.01.0/poppler/Form.cc
@@ -549,6 +549,7 @@ bool FormWidgetSignature::signDocument(c
GooString *fname = new GooString(saveFilename);
if (doc->saveAs(fname, writeForceIncremental) != errNone) {
fprintf(stderr, "signDocument: error saving to file \"%s\"\n", saveFilename);
+ delete fname;
return false;
}
@@ -563,6 +564,8 @@ bool FormWidgetSignature::signDocument(c
FILE *file = openFile(saveFilename, "r+b");
if (!updateOffsets(file, objStart, objEnd, &sigStart, &sigEnd, &fileSize)) {
fprintf(stderr, "signDocument: unable update byte range\n");
+ delete fname;
+ fclose(file);
return false;
}
@@ -574,15 +577,21 @@ bool FormWidgetSignature::signDocument(c
// and sign it
const std::unique_ptr<GooString> signature = sigHandler.signDetached(password);
- if (!signature)
+ if (!signature) {
+ delete fname;
+ fclose(file);
return false;
+ }
// write signature to saved file
if (!updateSignature(file, sigStart, sigEnd, signature.get())) {
fprintf(stderr, "signDocument: unable update signature\n");
+ delete fname;
+ fclose(file);
return false;
}
signatureField->setSignature(*signature);
+ delete fname;
fclose(file);
return true;
@@ -662,22 +670,30 @@ bool FormWidgetSignature::updateOffsets(
}
}
- if (*sigStart == -1 || *sigEnd == -1)
+ if (*sigStart == -1 || *sigEnd == -1) {
+ free(buf);
return false;
+ }
// Search for ByteRange array and update offsets
for (int i = 0; i < bufSize - 10; i++) {
if (buf[i] == '/' && strncmp(&buf[i], "/ByteRange", 10) == 0) {
// update range
char *p = setNextOffset(&buf[i], *sigStart);
- if (!p)
+ if (!p) {
+ free(buf);
return false;
+ }
p = setNextOffset(p, *sigEnd);
- if (!p)
+ if (!p) {
+ free(buf);
return false;
+ }
p = setNextOffset(p, *fileSize - *sigEnd);
- if (!p)
+ if (!p) {
+ free(buf);
return false;
+ }
break;
}
}
--- poppler-21.01.0/poppler/JBIG2Stream.cc
+++ poppler-21.01.0/poppler/JBIG2Stream.cc
@@ -2834,6 +2834,8 @@ JBIG2Bitmap *JBIG2Stream::readGenericBit
if (unlikely(!codingLine || !refLine)) {
error(errSyntaxError, curStr->getPos(), "Bad width in JBIG2 generic bitmap");
+ gfree(refLine);
+ gfree(codingLine);
delete bitmap;
return nullptr;
}
--- poppler-21.01.0/poppler/Lexer.cc
+++ poppler-21.01.0/poppler/Lexer.cc
@@ -461,6 +461,7 @@ Object Lexer::getObj(int objNum)
} else if (n == tokBufSize) {
error(errSyntaxError, getPos(), "Warning: name token is longer than what the specification says it can be");
*p = c;
+ delete s;
s = new GooString(tokBuf, n);
} else {
s->append((char)c);
@@ -468,6 +468,7 @@ Object Lexer::getObj(int objNum)
}
if (n < tokBufSize) {
*p = '\0';
+ delete s;
return Object(objName, tokBuf);
} else {
Object obj(objName, s->c_str());
--- poppler/poppler/CairoOutputDev.cc
+++ poppler/poppler/CairoOutputDev.cc
@@ -2921,8 +2921,10 @@ void CairoOutputDev::setMimeData(GfxStat
// colorspace in stream dict may be different from colorspace in jpx
// data
- if (strKind == strJPX && colorSpace)
+ if (strKind == strJPX && colorSpace) {
+ delete colorSpace;
return;
+ }
// only embed mime data for gray, rgb, and cmyk colorspaces.
if (colorSpace) {
--- poppler/poppler/TextOutputDev.cc
+++ poppler/poppler/TextOutputDev.cc
@@ -20,7 +20,7 @@
// Copyright (C) 2006 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2007, 2008, 2012, 2017 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2008 Koji Otani <sho@bbr.jp>
-// Copyright (C) 2008, 2010-2012, 2014-2020 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2008, 2010-2012, 2014-2021 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2008 Pino Toscano <pino@kde.org>
// Copyright (C) 2008, 2010 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2009 Ross Moore <ross@maths.mq.edu.au>
@@ -1619,7 +1619,6 @@ TextBlock::~TextBlock()
void TextBlock::addWord(TextWord *word)
{
- pool->addWord(word);
if (xMin > xMax) {
xMin = word->xMin;
xMax = word->xMax;
@@ -1639,6 +1638,7 @@ void TextBlock::addWord(TextWord *word)
yMax = word->yMax;
}
}
+ pool->addWord(word);
}
void TextBlock::coalesce(const UnicodeMap *uMap, double fixedPitch)
@@ -3064,11 +3064,13 @@ void TextPage::coalesce(bool physLayout,
word0 = pool->getPool(startBaseIdx);
pool->setPool(startBaseIdx, word0->next);
word0->next = nullptr;
- blk = new TextBlock(this, rot);
- blk->addWord(word0);
fontSize = word0->fontSize;
minBase = maxBase = word0->base;
+
+ blk = new TextBlock(this, rot);
+ blk->addWord(word0);
+
colSpace1 = minColSpacing1 * fontSize;
colSpace2 = minColSpacing2 * fontSize;
lineSpace = maxLineSpacingDelta * fontSize;
@@ -3095,9 +3097,9 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
+ newMinBase = word2->base;
blk->addWord(word2);
found = true;
- newMinBase = word2->base;
} else {
word0 = word1;
word1 = word1->next;
@@ -3123,9 +3125,9 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
+ newMaxBase = word2->base;
blk->addWord(word2);
found = true;
- newMaxBase = word2->base;
} else {
word0 = word1;
word1 = word1->next;
@@ -3198,12 +3200,12 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
- blk->addWord(word2);
if (word2->base < minBase) {
minBase = word2->base;
} else if (word2->base > maxBase) {
maxBase = word2->base;
}
+ blk->addWord(word2);
found = true;
break;
} else {
@@ -3246,12 +3248,12 @@ void TextPage::coalesce(bool physLayout,
}
word1 = word1->next;
word2->next = nullptr;
- blk->addWord(word2);
if (word2->base < minBase) {
minBase = word2->base;
} else if (word2->base > maxBase) {
maxBase = word2->base;
}
+ blk->addWord(word2);
found = true;
break;
} else {
@@ -4456,13 +4456,18 @@ class TextSelectionSizer : public TextSe
{
public:
TextSelectionSizer(TextPage *page, double scale);
- ~TextSelectionSizer() override { }
+ ~TextSelectionSizer() override { delete list; }
void visitBlock(TextBlock *block, TextLine *begin, TextLine *end, const PDFRectangle *selection) override {};
void visitLine(TextLine *line, TextWord *begin, TextWord *end, int edge_begin, int edge_end, const PDFRectangle *selection) override;
void visitWord(TextWord *word, int begin, int end, const PDFRectangle *selection) override {};
- std::vector<PDFRectangle *> *getRegion() { return list; }
+ std::vector<PDFRectangle *> *takeRegion()
+ {
+ auto aux = list;
+ list = nullptr;
+ return aux;
+ }
private:
std::vector<PDFRectangle *> *list;
@@ -5063,7 +5068,7 @@ std::vector<PDFRectangle *> *TextPage::g
visitSelection(&sizer, selection, style);
- return sizer.getRegion();
+ return sizer.takeRegion();
}
GooString *TextPage::getSelectionText(const PDFRectangle *selection, SelectionStyle style)
--- poppler/poppler/XRef.cc
+++ poppler/poppler/XRef.cc
@@ -402,6 +402,7 @@ int XRef::reserve(int newSize)
void *p = greallocn_checkoverflow(entries, realNewSize, sizeof(XRefEntry));
if (p == nullptr) {
+ entries = nullptr;
return 0;
}
@@ -835,7 +836,6 @@ bool XRef::constructXRef(bool *wasRecons
int offset = 0;
resize(0); // free entries properly
- gfree(entries);
capacity = 0;
size = 0;
entries = nullptr;
--- poppler/test/pdf-inspector.cc
+++ poppler/test/pdf-inspector.cc
@@ -43,6 +43,7 @@ class PdfInspector
{
public:
PdfInspector();
+ ~PdfInspector();
void set_file_name(const char *file_name);
void load(const char *file_name);
@@ -108,6 +109,11 @@ PdfInspector::PdfInspector()
load(nullptr);
}
+PdfInspector::~PdfInspector(void)
+{
+ delete output;
+}
+
void PdfInspector::set_file_name(const char *file_name)
{
GtkWidget *widget;
--- poppler/utils/HtmlOutputDev.cc
+++ poppler/utils/HtmlOutputDev.cc
@@ -1337,6 +1337,7 @@ void HtmlOutputDev::drawPngImage(GfxStat
// TODO can we calculate the resolution of the image?
if (!writer->init(f1, width, height, 72, 72)) {
error(errInternal, -1, "Can't init PNG for image '{0:t}'", fName);
+ delete fName;
delete writer;
fclose(f1);
return;
@@ -1378,6 +1378,7 @@ void HtmlOutputDev::drawPngImage(GfxStat
if (!writer->writeRow(row_pointer)) {
error(errIO, -1, "Failed to write into PNG '{0:t}'", fName);
+ delete fName;
delete writer;
delete imgStr;
fclose(f1);
@@ -1413,6 +1414,7 @@ void HtmlOutputDev::drawPngImage(GfxStat
if (!writer->writeRow(&png_row)) {
error(errIO, -1, "Failed to write into PNG '{0:t}'", fName);
+ delete fName;
delete writer;
fclose(f1);
gfree(png_row);
--- poppler/utils/pdftotext.cc
+++ poppler/utils/pdftotext.cc
@@ -329,6 +329,7 @@ int main(int argc, char *argv[])
fputs("<pre>\n", f);
if (f != stdout) {
fclose(f);
+ f = nullptr;
}
}
}
@@ -348,8 +349,9 @@ int main(int argc, char *argv[])
printWordBBox(f, doc, textOut, firstPage, lastPage);
}
}
- if (f != stdout) {
+ if (f != stdout && f != nullptr) {
fclose(f);
+ f = nullptr;
}
} else {
textOut = new TextOutputDev(textFileName->c_str(), physLayout, fixedPitch, rawOrder, htmlMeta, discardDiag);
@@ -390,7 +392,7 @@ int main(int argc, char *argv[])
fputs("</pre>\n", f);
fputs("</body>\n", f);
fputs("</html>\n", f);
- if (f != stdout) {
+ if (f != stdout && f != nullptr) {
fclose(f);
}
}
@@ -533,7 +533,9 @@ void printWordBBox(FILE *f, PDFDoc *doc,
for (int i = 0; i < word_length; ++i) {
word = wordlist->get(i);
word->getBBox(&xMinA, &yMinA, &xMaxA, &yMaxA);
- const std::string myString = myXmlTokenReplace(word->getText()->c_str());
+ GooString *wordText = word->getText();
+ const std::string myString = myXmlTokenReplace(wordText->c_str());
+ delete wordText;
fprintf(f, " <word xMin=\"%f\" yMin=\"%f\" xMax=\"%f\" yMax=\"%f\">%s</word>\n", xMinA, yMinA, xMaxA, yMaxA, myString.c_str());
}
fprintf(f, " </page>\n");

@ -6,6 +6,6 @@
set(INTROSPECTION_GIRS)
- set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all")
+ set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all" "--sources-top-dirs=${CMAKE_SOURCE_DIR}" "--sources-top-dirs=${CMAKE_BINARY_DIR}")
set(INTROSPECTION_COMPILER_ARGS "--includedir=${CMAKE_CURRENT_SOURCE_DIR}")
set(INTROSPECTION_COMPILER_ARGS ${INTROSPECTION_COMPILER_ARGS} "--includedir=${CMAKE_CURRENT_SOURCE_DIR}")
# Poppler: Assign package to gir & export keys

@ -1,58 +0,0 @@
From 81044c64b9ed9a10ae82a28bac753060bdfdac74 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Tue, 15 Mar 2022 15:14:32 +0100
Subject: Hints::readTables: bail out if we run out of file when reading
Fixes #1230
diff --git a/poppler/Hints.cc b/poppler/Hints.cc
index 79f04088..4707e1c6 100644
--- a/poppler/Hints.cc
+++ b/poppler/Hints.cc
@@ -5,7 +5,7 @@
// This file is licensed under the GPLv2 or later
//
// Copyright 2010, 2012 Hib Eris <hib@hiberis.nl>
-// Copyright 2010, 2011, 2013, 2014, 2016-2019 Albert Astals Cid <aacid@kde.org>
+// Copyright 2010, 2011, 2013, 2014, 2016-2019, 2021, 2022 Albert Astals Cid <aacid@kde.org>
// Copyright 2010, 2013 Pino Toscano <pino@kde.org>
// Copyright 2013 Adrian Johnson <ajohnson@redneon.com>
// Copyright 2014 Fabio D'Urso <fabiodurso@hotmail.it>
@@ -189,21 +189,31 @@ void Hints::readTables(BaseStream *str, Linearization *linearization, XRef *xref
char *p = &buf[0];
if (hintsOffset && hintsLength) {
- Stream *s = str->makeSubStream(hintsOffset, false, hintsLength, Object(objNull));
+ std::unique_ptr<Stream> s(str->makeSubStream(hintsOffset, false, hintsLength, Object(objNull)));
s->reset();
for (unsigned int i = 0; i < hintsLength; i++) {
- *p++ = s->getChar();
+ const int c = s->getChar();
+ if (unlikely(c == EOF)) {
+ error(errSyntaxWarning, -1, "Found EOF while reading hints");
+ ok = false;
+ return;
+ }
+ *p++ = c;
}
- delete s;
}
if (hintsOffset2 && hintsLength2) {
- Stream *s = str->makeSubStream(hintsOffset2, false, hintsLength2, Object(objNull));
+ std::unique_ptr<Stream> s(str->makeSubStream(hintsOffset2, false, hintsLength2, Object(objNull)));
s->reset();
for (unsigned int i = 0; i < hintsLength2; i++) {
- *p++ = s->getChar();
+ const int c = s->getChar();
+ if (unlikely(c == EOF)) {
+ error(errSyntaxWarning, -1, "Found EOF while reading hints2");
+ ok = false;
+ return;
+ }
+ *p++ = c;
}
- delete s;
}
MemStream *memStream = new MemStream(&buf[0], 0, bufLength, Object(objNull));

@ -1,26 +0,0 @@
From 27354e9d9696ee2bc063910a6c9a6b27c5184a52 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Thu, 25 Aug 2022 00:14:22 +0200
Subject: JBIG2Stream: Fix crash on broken file
https://github.com/jeffssh/CVE-2021-30860
Thanks to David Warren for the heads up
diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index 662276e5..9f70431d 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -1976,7 +1976,11 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm, bool lossless
for (i = 0; i < nRefSegs; ++i) {
if ((seg = findSegment(refSegs[i]))) {
if (seg->getType() == jbig2SegSymbolDict) {
- numSyms += ((JBIG2SymbolDict *)seg)->getSize();
+ const unsigned int segSize = ((JBIG2SymbolDict *)seg)->getSize();
+ if (unlikely(checkedAdd(numSyms, segSize, &numSyms))) {
+ error(errSyntaxError, getPos(), "Too many symbols in JBIG2 text region");
+ return;
+ }
} else if (seg->getType() == jbig2SegCodeTable) {
codeTables->push_back(seg);
}

File diff suppressed because it is too large Load Diff

@ -1,48 +0,0 @@
From efb68686784f0c58668b7ced990fd173e09346db Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Thu, 18 Aug 2022 23:41:24 +0200
Subject: pdfunite: Don't crash in broken documents
diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc
index 86e75555..a154f40d 100644
--- a/utils/pdfunite.cc
+++ b/utils/pdfunite.cc
@@ -106,16 +106,21 @@ static void doMergeNameDict(PDFDoc *doc, XRef *srcXRef, XRef *countRef, int oldR
}
}
-static void doMergeFormDict(Dict *srcFormDict, Dict *mergeFormDict, int numOffset)
+static bool doMergeFormDict(Dict *srcFormDict, Dict *mergeFormDict, int numOffset)
{
Object srcFields = srcFormDict->lookup("Fields");
Object mergeFields = mergeFormDict->lookup("Fields");
if (srcFields.isArray() && mergeFields.isArray()) {
for (int i = 0; i < mergeFields.arrayGetLength(); i++) {
const Object &value = mergeFields.arrayGetNF(i);
+ if (!value.isRef()) {
+ error(errSyntaxError, -1, "Fields object is not a Ref.");
+ return false;
+ }
srcFields.arrayAdd(Object({ value.getRef().num + numOffset, value.getRef().gen }));
}
}
+ return true;
}
///////////////////////////////////////////////////////////////////////////
@@ -332,7 +337,13 @@ int main(int argc, char *argv[])
if (afObj.isNull()) {
afObj = pageCatDict->lookupNF("AcroForm").copy();
} else if (afObj.isDict()) {
- doMergeFormDict(afObj.getDict(), pageForm.getDict(), numOffset);
+ if (!doMergeFormDict(afObj.getDict(), pageForm.getDict(), numOffset)) {
+ fclose(f);
+ delete yRef;
+ delete countRef;
+ delete outStr;
+ return -1;
+ }
}
}
objectsCount += docs[i]->writePageObjects(outStr, yRef, numOffset, true);

@ -1,41 +0,0 @@
From 4631115647c1e4f0482ffe0491c2f38d2231337b Mon Sep 17 00:00:00 2001
From: crt <chluo@cse.cuhk.edu.hk>
Date: Fri, 29 Jul 2022 20:51:11 +0000
Subject: Check isDict before calling getDict
Issue #1276
diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc
index b96b0378..050927d3 100644
--- a/utils/pdfunite.cc
+++ b/utils/pdfunite.cc
@@ -197,6 +197,14 @@ int main(int argc, char *argv[])
Object ocObj;
if (docs.size() >= 1) {
Object catObj = docs[0]->getXRef()->getCatalog();
+ if(!catObj.isDict()){
+ fclose(f);
+ delete yRef;
+ delete countRef;
+ delete outStr;
+ error(errSyntaxError, -1, "XRef's Catalog is not a dictionary.");
+ return -1;
+ }
Dict *catDict = catObj.getDict();
intents = catDict->lookup("OutputIntents");
afObj = catDict->lookupNF("AcroForm").copy();
@@ -295,6 +303,14 @@ int main(int argc, char *argv[])
}
}
Object pageCatObj = docs[i]->getXRef()->getCatalog();
+ if(!pageCatObj.isDict()){
+ fclose(f);
+ delete yRef;
+ delete countRef;
+ delete outStr;
+ error(errSyntaxError, -1, "XRef's Catalog is not a dictionary.");
+ return -1;
+ }
Dict *pageCatDict = pageCatObj.getDict();
Object pageNames = pageCatDict->lookup("Names");
if (!pageNames.isNull() && pageNames.isDict()) {

@ -1,28 +0,0 @@
From 5dbe101b7c3561aedf33872e218b8d1b6984f623 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Sat, 8 May 2021 00:54:13 +0200
Subject: [PATCH] Restore setting the Encoding in createAnnotDrawFont
It was removed in 9db685f379c1c9195b5f0c9a693e7a581e6b214f and as far as
i remember the reason was that signatures created with that hung Adobe
Reader, but I can't reproduce it anymore and on top of that is causing
regressions when rendering PDF files (Issue #1070) so restore it.
---
poppler/Annot.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 5287b4dc..40b1085a 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -2852,6 +2852,7 @@ static GfxFont *createAnnotDrawFont(XRef *xref, Dict *fontParentDict, const char
Dict *fontDict = new Dict(xref);
fontDict->add("BaseFont", Object(objName, fontname));
fontDict->add("Subtype", Object(objName, "Type1"));
+ fontDict->add("Encoding", Object(objName, "WinAnsiEncoding"));
Object fontsDictObj = fontParentDict->lookup("Font");
if (!fontsDictObj.isDict()) {
--
2.31.1

@ -0,0 +1,102 @@
From 0554731052d1a97745cb179ab0d45620589dd9c4 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Fri, 7 Jun 2024 00:54:55 +0200
Subject: pdfinfo: Fix crash in broken documents when using -dests
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc
index 5d37ef64..7d569749 100644
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@ -15,7 +15,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2006 Dom Lachowicz <cinamod@hotmail.com>
-// Copyright (C) 2007-2010, 2012, 2016-2022 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2007-2010, 2012, 2016-2022, 2024 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2011 Vittal Aithal <vittal.aithal@cognidox.com>
// Copyright (C) 2012, 2013, 2016-2018, 2021 Adrian Johnson <ajohnson@redneon.com>
@@ -113,16 +113,21 @@ static const ArgDesc argDesc[] = { { "-f", argInt, &firstPage, 0, "first page to
{ "-?", argFlag, &printHelp, 0, "print usage information" },
{} };
-static void printTextString(const GooString *s, const UnicodeMap *uMap)
+static void printStdTextString(const std::string &s, const UnicodeMap *uMap)
{
char buf[8];
- std::vector<Unicode> u = TextStringToUCS4(s->toStr());
+ const std::vector<Unicode> u = TextStringToUCS4(s);
for (const auto &c : u) {
int n = uMap->mapUnicode(c, buf, sizeof(buf));
fwrite(buf, 1, n, stdout);
}
}
+static void printTextString(const GooString *s, const UnicodeMap *uMap)
+{
+ printStdTextString(s->toStr(), uMap);
+}
+
static void printUCS4String(const Unicode *u, int len, const UnicodeMap *uMap)
{
char buf[8];
@@ -294,11 +299,6 @@ static void printStruct(const StructElement *element, unsigned indent)
}
}
-struct GooStringCompare
-{
- bool operator()(GooString *lhs, GooString *rhs) const { return lhs->cmp(const_cast<GooString *>(rhs)) < 0; }
-};
-
static void printLinkDest(const std::unique_ptr<LinkDest> &dest)
{
GooString s;
@@ -369,29 +369,25 @@ static void printLinkDest(const std::unique_ptr<LinkDest> &dest)
static void printDestinations(PDFDoc *doc, const UnicodeMap *uMap)
{
- std::map<Ref, std::map<GooString *, std::unique_ptr<LinkDest>, GooStringCompare>> map;
+ std::map<Ref, std::map<std::string, std::unique_ptr<LinkDest>>> map;
int numDests = doc->getCatalog()->numDestNameTree();
for (int i = 0; i < numDests; i++) {
- GooString *name = new GooString(doc->getCatalog()->getDestNameTreeName(i));
+ const GooString *name = doc->getCatalog()->getDestNameTreeName(i);
std::unique_ptr<LinkDest> dest = doc->getCatalog()->getDestNameTreeDest(i);
- if (dest && dest->isPageRef()) {
+ if (name && dest && dest->isPageRef()) {
Ref pageRef = dest->getPageRef();
- map[pageRef].insert(std::make_pair(name, std::move(dest)));
- } else {
- delete name;
+ map[pageRef].insert(std::make_pair(name->toStr(), std::move(dest)));
}
}
numDests = doc->getCatalog()->numDests();
for (int i = 0; i < numDests; i++) {
- GooString *name = new GooString(doc->getCatalog()->getDestsName(i));
+ const char *name = doc->getCatalog()->getDestsName(i);
std::unique_ptr<LinkDest> dest = doc->getCatalog()->getDestsDest(i);
- if (dest && dest->isPageRef()) {
+ if (name && dest && dest->isPageRef()) {
Ref pageRef = dest->getPageRef();
map[pageRef].insert(std::make_pair(name, std::move(dest)));
- } else {
- delete name;
}
}
@@ -405,9 +401,8 @@ static void printDestinations(PDFDoc *doc, const UnicodeMap *uMap)
printf("%4d ", i);
printLinkDest(it.second);
printf(" \"");
- printTextString(it.first, uMap);
+ printStdTextString(it.first, uMap);
printf("\"\n");
- delete it.first;
}
}
}

@ -1,27 +0,0 @@
diff --git a/glib/poppler-enums.c.template b/glib/poppler-enums.c.template
index 26a51b4..27be2b9 100644
--- a/glib/poppler-enums.c.template
+++ b/glib/poppler-enums.c.template
@@ -15,7 +15,7 @@
GType
@enum_name@_get_type (void)
{
- static volatile gsize g_define_type_id__volatile = 0;
+ static gsize g_define_type_id__volatile = 0;
if (g_once_init_enter (&g_define_type_id__volatile)) {
static const G@Type@Value values[] = {
diff --git a/glib/poppler-private.h b/glib/poppler-private.h
index 7726ec7..436bca5 100644
--- a/glib/poppler-private.h
+++ b/glib/poppler-private.h
@@ -167,7 +167,7 @@ gboolean _poppler_convert_pdf_date_to_gtime (const GooString *date,
#define POPPLER_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) \
GType type_name##_get_type(void) \
{ \
- static volatile gsize g_define_type_id__volatile = 0; \
+ static gsize g_define_type_id__volatile = 0; \
if (g_once_init_enter(&g_define_type_id__volatile)) { \
GType g_define_type_id = g_boxed_type_register_static(g_intern_static_string(#TypeName), (GBoxedCopyFunc)copy_func, (GBoxedFreeFunc)free_func); \
g_once_init_leave(&g_define_type_id__volatile, g_define_type_id); \

@ -1,51 +1,35 @@
%global test_date 2021-06-14
%global test_sha 03a4b9eb854a06a83c465e82de601796c458bbe9
%global test_date 2021-01-11
%bcond qt 1
%if %{with qt}
# Enable qt5 support (or not)
# RHEL 10 drops support for Qt5, adds Qt6
%if %{undefined rhel} || 0%{?rhel} < 10
%global qt5 1
%endif
%if %{undefined rhel} || 0%{?rhel} >= 10
%global qt6 1
%endif
%endif
Summary: PDF rendering library
Name: poppler
Version: 21.01.0
Release: 18%{?dist}
License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT
Version: 24.02.0
Release: 5%{?dist}
License: (GPL-2.0-only OR GPL-3.0-only) AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
URL: http://poppler.freedesktop.org/
Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz
# git archive --prefix test/
Source1: %{name}-test-%{test_date}.tar.xz
# https://bugzilla.redhat.com/show_bug.cgi?id=1185007
Patch0: poppler-0.30.0-rotated-words-selection.patch
Source1: %{name}-test-%{test_date}-%{test_sha}.tar.xz
Patch1: poppler-0.90.0-position-independent-code.patch
# Bogus volatiles detected by gcc-11
Patch2: %{name}-gcc11.patch
Patch3: poppler-21.01.0-glib-introspection.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1944726
Patch4: poppler-21.01.0-nss.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1968289
Patch5: poppler-21.01.0-show-annotation-text.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1967967
Patch6: poppler-21.01.0-covscan.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2087190
Patch7: poppler-21.01.0-hints.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2124527
Patch8: poppler-21.01.0-jbig-symbol-overflow.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2189815
Patch9: poppler-21.01.0-pdfunite-broken-document.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2189811
Patch10: poppler-21.01.0-pdfunite-check-isDict.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2189814
Patch11: poppler-21.01.0-check-isDict.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2189810
Patch12: poppler-21.01.0-XRef-check-isDict.patch
# https://issues.redhat.com/browse/RHEL-44326
Patch4: poppler-24.02.0-pdfinfo-dests.patch
BuildRequires: make
BuildRequires: cmake
@ -71,11 +55,23 @@ BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libtiff-4)
BuildRequires: pkgconfig(nss)
BuildRequires: pkgconfig(poppler-data)
BuildRequires: pkgconfig(libcurl)
BuildRequires: cmake(Gpgmepp)
%if 0%{?qt5}
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5Xml)
%endif
%if 0%{?qt6}
BuildRequires: cmake(Qt6Core)
BuildRequires: cmake(Qt6Gui)
BuildRequires: cmake(Qt6Test)
BuildRequires: cmake(Qt6Widgets)
BuildRequires: cmake(Qt6Xml)
%endif
BuildRequires: boost-devel
Requires: poppler-data
@ -115,6 +111,7 @@ BuildArch: noarch
%description glib-doc
%{summary}.
%if 0%{?qt5}
%package qt5
Summary: Qt5 wrapper for poppler
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -130,6 +127,23 @@ Requires: qt5-qtbase-devel
Obsoletes: %{name}-qt-devel < 0.90.0-9
%description qt5-devel
%{summary}.
%endif
%if 0%{?qt6}
%package qt6
Summary: Qt6 wrapper for poppler
Requires: %{name}%{?_isa} = %{version}-%{release}
%description qt6
%{summary}.
%package qt6-devel
Summary: Development files for Qt6 wrapper
Requires: %{name}-qt6%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: qt6-qtbase-devel
%description qt6-devel
%{summary}.
%endif
%package cpp
Summary: Pure C++ wrapper for poppler
@ -164,6 +178,12 @@ chmod -x poppler/CairoFontEngine.cc
-DENABLE_DCTDECODER=libjpeg \
-DENABLE_GTK_DOC=ON \
-DENABLE_LIBOPENJPEG=openjpeg2 \
%if ! 0%{?qt5}
-DENABLE_QT5=OFF \
%endif
%if ! 0%{?qt6}
-DENABLE_QT6=OFF \
%endif
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
-DENABLE_ZLIB=OFF \
..
@ -180,20 +200,31 @@ export PKG_CONFIG_PATH=%{buildroot}%{_datadir}/pkgconfig:%{buildroot}%{_libdir}/
test "$(pkg-config --modversion poppler)" = "%{version}"
test "$(pkg-config --modversion poppler-cpp)" = "%{version}"
test "$(pkg-config --modversion poppler-glib)" = "%{version}"
%if 0%{?qt5}
test "$(pkg-config --modversion poppler-qt5)" = "%{version}"
%endif
%if 0%{?qt6}
test "$(pkg-config --modversion poppler-qt6)" = "%{version}"
%endif
%ldconfig_scriptlets
%ldconfig_scriptlets glib
%if 0%{?qt5}
%ldconfig_scriptlets qt5
%endif
%if 0%{?qt6}
%ldconfig_scriptlets qt6
%endif
%ldconfig_scriptlets cpp
%files
%doc README.md
%license COPYING
%{_libdir}/libpoppler.so.106*
%{_libdir}/libpoppler.so.134*
%files devel
%{_libdir}/pkgconfig/poppler.pc
@ -219,6 +250,7 @@ test "$(pkg-config --modversion poppler-qt5)" = "%{version}"
%license COPYING
%{_datadir}/gtk-doc/
%if 0%{?qt5}
%files qt5
%{_libdir}/libpoppler-qt5.so.1*
@ -226,6 +258,17 @@ test "$(pkg-config --modversion poppler-qt5)" = "%{version}"
%{_libdir}/libpoppler-qt5.so
%{_libdir}/pkgconfig/poppler-qt5.pc
%{_includedir}/poppler/qt5/
%endif
%if 0%{?qt6}
%files qt6
%{_libdir}/libpoppler-qt6.so.3*
%files qt6-devel
%{_libdir}/libpoppler-qt6.so
%{_libdir}/pkgconfig/poppler-qt6.pc
%{_includedir}/poppler/qt6/
%endif
%files cpp
%{_libdir}/libpoppler-cpp.so.0*
@ -240,55 +283,109 @@ test "$(pkg-config --modversion poppler-qt5)" = "%{version}"
%{_mandir}/man1/*
%changelog
* Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 21.01.0-18
- Check XRef's Catalog for being a Dict
- Resolves: #2189820
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 24.02.0-5
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Fri Oct 25 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 24.02.0-4
- Rebuilt for MSVSphere 10
* Fri Jul 26 2024 Marek Kasik <mkasik@redhat.com> - 24.02.0-4
- Fix crash in broken documents when using -dests
- Resolves: RHEL-44326
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 24.02.0-3
- Bump release for June 2024 mass rebuild
* Tue Feb 6 2024 Marek Kasik <mkasik@redhat.com> - 24.02.0-2
- Migrated to SPDX license
* Fri Feb 2 2024 Marek Kasik <mkasik@redhat.com> - 24.02.0-1
- Update to 24.02.0
- Resolves: #2237549
* Fri Feb 2 2024 Marie Loise Nolden <loise@kde.org> - 24.01.0-1
- update to 24.01.9
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 23.08.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 23.08.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 21.01.0-17
- Check isDict before calling getDict 2
- Resolves: #2189841
* Wed Aug 2 2023 Marek Kasik <mkasik@redhat.com> - 23.08.0-1
- Update to 23.08.0
* Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 21.01.0-16
- Check isDict before calling getDict
- Resolves: #2189827
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 23.02.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 21.01.0-15
- Don't crash in broken documents
- Resolves: #2189848
* Mon Jun 19 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 23.02.0-2
- Disable qt5 in RHEL 10 builds
- Enable qt6 on s390x
* Mon Sep 26 2022 Marek Kasik <mkasik@redhat.com> - 21.01.0-14
* Fri Feb 3 2023 Marek Kasik <mkasik@redhat.com> - 23.02.0-1
- Update to 23.02.0
- Resolves: #2123190
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 22.08.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Nov 29 2022 Marek Kasik <mkasik@redhat.com> - 22.08.0-4
- Update font after restore in Cairo
- Provide Unicode marker when ensuring fonts
* Wed Oct 05 2022 Marek Kasik <mkasik@redhat.com> - 22.08.0-3
- Check for overflow when computing number of symbols
- in JBIG2 text region
- Resolves: #2126364
- Resolves: #2124530
* Tue Sep 6 2022 Amit Shah <amitshah@fedoraproject.org> - 22.08.0-2
- Allow building without Qt
* Tue Aug 2 2022 Marek Kasik <mkasik@redhat.com> - 22.08.0-1
- Update to 22.08.0
- Resolves: #2049336
* Fri Jun 17 2022 Marek Kasik <mkasik@redhat.com> - 21.01.0-13
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 22.01.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Jun 15 2022 Marek Kasik <mkasik@redhat.com> - 22.01.0-5
- Don't run out of file for Hints
- Rebuild for #2096451
- Resolves: #2090970, #2096451
- Resolves: #2090965
* Fri May 20 2022 Sandro Mani <manisandro@gmail.com> - 22.01.0-4
- Rebuild for gdal-3.5.0 and/or openjpeg-2.5.0
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 22.01.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jan 14 2022 Sandro Mani <manisandro@gmail.com> - 22.01.0-2
- Enable qt6
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 21.01.0-12
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Jan 13 2022 Marek Kasik <mkasik@redhat.com> - 22.01.0-1
- Update to 22.01.0
- Resolves: #2000346
* Thu Jun 17 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-11
- Backport fixes for issues found by Coverity Scan
- and fix some of the new issues
- Resolves: #1967967
* Mon Aug 2 2021 Marek Kasik <mkasik@redhat.com> - 21.08.0-1
- Update to 21.08.0
- Resolves: #1923798, #1988844
* Mon Jun 14 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-10
- Fix showing of upper-case non-ASCII characters in annotations
- Resolves: #1968289
* Mon Jul 26 2021 Marek Kasik <mkasik@redhat.com> - 21.07.0-2
- Disable qt6 frontend as it doesn't build on s390x
- Resolves: #1923798
* Mon Jun 14 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-9
- Remove searchAcrossLines.pdf due to license
- Resolves: #1967921
* Mon Jul 26 2021 Marek Kasik <mkasik@redhat.com> - 21.07.0-1
- Update to 21.07.0
- Add requirement of boost for performance gain in splash
- Add qt6 subpackages
- Resolves: #1923798
* Mon May 10 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-8
- Implement crypto functions using NSS
- Resolves: #1944726
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 21.01.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 21.01.0-7
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jun 1 2021 Marek Kasik <mkasik@redhat.com> - 21.01.0-7
- Fix showing of non-ASCII characters in annotations
- Resolves: #1958673
* Tue Mar 30 2021 Jonathan Wakely <jwakely@redhat.com> - 21.01.0-6
- Rebuilt for removed libstdc++ symbol (#1937698)

Loading…
Cancel
Save