This commit is contained in:
Zdenek Dohnal 2018-09-10 18:11:31 +02:00
parent 5d00506944
commit 71c6baacf4
5 changed files with 7 additions and 858 deletions

1
.gitignore vendored
View File

@ -85,3 +85,4 @@
/cups-filters-1.20.1.tar.xz
/cups-filters-1.20.2.tar.xz
/cups-filters-1.20.3.tar.xz
/cups-filters-1.21.2.tar.xz

View File

@ -3,8 +3,8 @@
Summary: OpenPrinting CUPS filters and backends
Name: cups-filters
Version: 1.20.3
Release: 7%{?dist}
Version: 1.21.2
Release: 1%{?dist}
# For a breakdown of the licensing, see COPYING file
# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
@ -21,7 +21,6 @@ Url: http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups
Source0: http://www.openprinting.org/download/cups-filters/cups-filters-%{version}.tar.xz
Patch01: cups-filters-createall.patch
Patch02: poppler-0.64.patch
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
@ -120,7 +119,6 @@ This is the development package for OpenPrinting CUPS filters and backends.
# set LocalQueueNamingRemoteCUPS and CreateIPPPrinterQueues by default
%patch01 -p1 -b .createall
%patch02 -p1 -b .poppler-0.64
%build
# work-around Rpath
@ -293,6 +291,9 @@ fi
%{_libdir}/libfontembed.so
%changelog
* Mon Sep 10 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.21.2-1
- 1.21.2
* Tue Aug 14 2018 Marek Kasik <mkasik@redhat.com> - 1.20.3-7
- Rebuild for poppler-0.67.0

View File

@ -1,825 +0,0 @@
=== modified file 'filter/pdf.cxx'
--- filter/pdf.cxx 2017-08-15 18:32:47 +0000
+++ filter/pdf.cxx 2017-09-07 16:02:01 +0000
@@ -129,64 +129,125 @@
Object array;
Ref r;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ pageobj = xref->fetch(pageref->num, pageref->gen);
+#else
xref->fetch(pageref->num, pageref->gen, &pageobj);
- if (!pageobj.isDict() || !pageobj.dictLookupNF("Contents", &contents)) {
+#endif
+ if (!pageobj.isDict() ||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ (contents = pageobj.dictLookupNF("Contents")).isNull()
+#else
+ !pageobj.dictLookupNF("Contents", &contents)
+#endif
+ ) {
fprintf(stderr, "Error: malformed pdf\n");
return;
}
- if (contents.isRef())
+ if (contents.isRef()) {
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ contents = xref->fetch(contents.getRefNum(), contents.getRefGen());
+#else
xref->fetch(contents.getRefNum(), contents.getRefGen(), &contents);
+#endif
+ }
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ (void) lenobj;
+ dict = Object(new Dict(xref));
+ dict.dictSet("Length", Object(static_cast<int>(len)));
+ stream = Object(static_cast<Stream *>(new MemStream(buf, 0, len, std::move(dict))));
+#else
lenobj.initInt(len);
dict.initDict(xref);
dict.dictSet("Length", &lenobj);
stream.initStream(new MemStream(buf, 0, len, &dict));
+#endif
r = xref->addIndirectObject(&stream);
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ streamrefobj = Object(r.num, r.gen);
+#else
streamrefobj.initRef(r.num, r.gen);
+#endif
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ array = Object(new Array(xref));
+ array.arrayAdd(std::move(streamrefobj));
+#else
array.initArray(xref);
array.arrayAdd(&streamrefobj);
+#endif
if (contents.isStream()) {
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ contents = pageobj.dictLookupNF("Contents"); // streams must be indirect, i.e. not fetch()-ed
+ array.arrayAdd(std::move(contents));
+#else
pageobj.dictLookupNF("Contents", &contents); // streams must be indirect, i.e. not fetch()-ed
array.arrayAdd(&contents);
+#endif
}
else if (contents.isArray()) {
int i, len = contents.arrayGetLength();
Object obj;
for (i = 0; i < len; i++) {
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ obj = contents.arrayGetNF(i);
+ array.arrayAdd(std::move(obj));
+#else
contents.arrayGetNF(i, &obj);
array.arrayAdd(&obj);
+#endif
}
}
else
fprintf(stderr, "Error: malformed pdf\n");
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ pageobj.dictSet("Contents", std::move(array));
+#else
pageobj.dictSet("Contents", &array);
+#endif
xref->setModifiedObject(&pageobj, *pageref);
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
pageobj.free();
-}
-
-
+#endif
+}
+
+
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+static Object name_object(const char *s)
+{
+ return Object(new GooString(s));
+}
+#else
static Object * name_object(const char *s)
{
Object *o = new Object();
o->initName((char *)s);
return o;
}
+#endif
/*
* Create new PDF integer type object.
*/
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+static Object int_object(int i)
+{
+ return Object(i);
+}
+#else
static Object * int_object(int i)
{
Object *o = new Object();
o->initInt(i);
return o;
}
+#endif
static Object * get_resource_dict(XRef *xref,
Dict *pagedict,
@@ -196,21 +257,36 @@
Object res;
/* TODO resource dict can also be inherited */
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ res = pagedict->lookupNF("Resources");
+ if (res.isNull())
+#else
if (!pagedict->lookupNF("Resources", &res))
+#endif
return NULL;
if (res.isRef()) {
*resref = res.getRef();
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ *resdict = xref->fetch(resref->num, resref->gen);
+#else
xref->fetch(resref->num, resref->gen, resdict);
+#endif
}
else if (res.isDict()) {
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ *resdict = res.copy();
+#else
res.copy(resdict);
+#endif
resref->num = 0;
}
else
resdict = NULL;
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
res.free();
+#endif
return resdict;
}
@@ -226,7 +302,11 @@
Object resdict;
Ref resref;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ pageobj = xref->fetch(pageref->num, pageref->gen);
+#else
xref->fetch(pageref->num, pageref->gen, &pageobj);
+#endif
if (!pageobj.isDict()) {
fprintf(stderr, "Error: malformed pdf\n");
return;
@@ -234,21 +314,35 @@
if (!get_resource_dict(xref, pageobj.getDict(), &resdict, &resref)) {
fprintf(stderr, "Error: malformed pdf\n");
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
pageobj.free();
+#endif
return;
}
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ font = Object(new Dict(xref));
+#else
font.initDict(xref);
+#endif
font.dictSet("Type", name_object("Font"));
font.dictSet("Subtype", name_object("Type1"));
font.dictSet("BaseFont", name_object(name));
xref->addIndirectObject(&font);
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ fonts = resdict.dictLookupNF("Font");
+#else
resdict.dictLookupNF("Font", &fonts);
+#endif
if (fonts.isNull()) {
/* Create new font dic obj in page's resources */
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ resdict.dictSet("Font", Object(new Dict(xref)));
+#else
fonts.initDict(xref);
resdict.dictSet("Font", &fonts);
+#endif
}
Object *fonts_dic;
@@ -259,7 +353,11 @@
fonts_dic = &fonts;
} else if ( fonts.isRef() ) {
/* "Font" resource is indirect reference object */
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ dereferenced_obj = xref->fetch(fonts.getRefNum(), fonts.getRefGen());
+#else
xref->fetch(fonts.getRefNum(), fonts.getRefGen(), &dereferenced_obj);
+#endif
fonts_dic = &dereferenced_obj;
}
@@ -269,7 +367,11 @@
}
/* Add new entry to "Font" resource */
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ fonts_dic->dictSet("bannertopdf-font", std::move(font));
+#else
fonts_dic->dictSet("bannertopdf-font", &font);
+#endif
/* Notify poppler about changes */
if ( fonts.isRef() ) {
@@ -281,7 +383,9 @@
else
xref->setModifiedObject(&resdict, resref);
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
pageobj.free();
+#endif
}
@@ -293,23 +397,38 @@
Array *array;
int i;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ o = dict->dictLookup(key);
+ if (o.isNull())
+#else
if (!dict->dictLookup(key, &o))
+#endif
return false;
if (!o.isArray()) {
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
o.free();
+#endif
return false;
}
array = o.getArray();
for (i = 0; i < 4; i++) {
Object el;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ el = array->get(i);
+ if (el.isNum())
+ rect[i] = el.getNum();
+#else
if (array->get(i, &el) && el.isNum())
rect[i] = el.getNum();
el.free();
+#endif
}
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
o.free();
+#endif
return i == 4;
}
@@ -322,6 +441,15 @@
Object array;
int i;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ array = Object(new Array(xref));
+
+ for (i = 0; i < 4; i++) {
+ array.arrayAdd(Object(static_cast<double>(rect[i])));
+ }
+
+ dict->dictSet(key, std::move(array));
+#else
array.initArray(xref);
for (i = 0; i < 4; i++) {
@@ -331,6 +459,7 @@
}
dict->dictSet(key, &array);
+#endif
}
@@ -361,7 +490,11 @@
float mediabox[4] = { 0.0, 0.0, width, length };
float old_mediabox[4];
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ pageobj = xref->fetch(pageref->num, pageref->gen);
+#else
xref->fetch(pageref->num, pageref->gen, &pageobj);
+#endif
if (!pageobj.isDict()) {
fprintf(stderr, "Error: malformed pdf\n");
return;
@@ -381,7 +514,9 @@
dict_set_rect (xref, &pageobj, "BleedBox", mediabox);
xref->setModifiedObject(&pageobj, *pageref);
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
pageobj.free();
+#endif
}
@@ -394,21 +529,34 @@
Object page, parentref, parent, kids, ref, countobj;
int i;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ page = xref->fetch(pageref->num, pageref->gen);
+#else
xref->fetch(pageref->num, pageref->gen, &page);
+#endif
if (!page.isDict("Page")) {
fprintf(stderr, "Error: malformed pdf (invalid Page object)\n");
return;
}
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ parentref = page.dictLookupNF("Parent");
+ parent = parentref.fetch(xref);
+#else
page.dictLookupNF("Parent", &parentref);
parentref.fetch(xref, &parent);
+#endif
if (!parent.isDict("Pages")) {
fprintf(stderr, "Error: malformed pdf (Page.Parent must point to a "
"Pages object)\n");
return;
}
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ kids = parent.dictLookup("Kids");
+#else
parent.dictLookup("Kids", &kids);
+#endif
if (!kids.isArray()) {
fprintf(stderr, "Error: malformed pdf (Pages.Kids must be an array)\n");
return;
@@ -420,14 +568,22 @@
// the pages tree (not supported by major pdf implementations).
for (i = 1; i < count; i++) {
Ref r = xref->addIndirectObject(&page);
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ kids.arrayAdd(Object(r.num, r.gen));
+#else
ref.initRef(r.num, r.gen);
kids.arrayAdd(&ref);
ref.free();
+#endif
}
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ parent.dictSet("Count", Object(count));
+#else
countobj.initInt(count);
parent.dictSet("Count", &countobj);
countobj.free();
+#endif
xref->setModifiedObject(&parent, parentref.getRef());
}
@@ -523,7 +679,11 @@
}
Object pageobj;
Ref pageref = page->getRef();
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ pageobj = xref->fetch(pageref.num, pageref.gen);
+#else
xref->fetch(pageref.num, pageref.gen, &pageobj);
+#endif
const char *font_size = lookup_opt(opt, "banner-font-size");
if ( ! font_size ) {
@@ -614,8 +774,12 @@
/* Modify field's appearance */
Object appearance_obj;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ field_obj->getDict()->set("DA", Object(appearance));
+#else
appearance_obj.initString(appearance);
field_obj->getDict()->set("DA", &appearance_obj);
+#endif
/*
* Create /AP - entry stuff.
@@ -653,7 +817,11 @@
appearance_stream->append("EMC\n");
Object appearance_stream_dic;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ appearance_stream_dic = Object(new Dict(xref));
+#else
appearance_stream_dic.initDict(xref);
+#endif
/*
* Appearance stream dic.
@@ -663,12 +831,46 @@
appearance_stream_dic.dictSet("Type", name_object("XObject"));
appearance_stream_dic.dictSet("Subtype", name_object("Form"));
appearance_stream_dic.dictSet("FormType", int_object(1));
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ appearance_stream_dic.dictSet("Resources", Object(resref.num, resref.gen));
+#else
Object obj_ref_x;
obj_ref_x.initRef(resref.num, resref.gen);
appearance_stream_dic.dictSet("Resources", &obj_ref_x);
+#endif
/* BBox array: TODO. currently out of the head. */
Object array;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ array = Object(new Array(xref));
+ array.arrayAdd(Object(0.0));
+ array.arrayAdd(Object(0.0));
+ array.arrayAdd(Object(237.0));
+ array.arrayAdd(Object(25.0));
+
+ appearance_stream_dic.dictSet("BBox", std::move(array));
+ appearance_stream_dic.dictSet("Length", Object(appearance_stream->getLength()));
+
+ MemStream *mem_stream = new MemStream(appearance_stream->getCString(),
+ 0, appearance_stream->getLength(), std::move(appearance_stream_dic));
+
+ /* Make obj stream */
+ Object stream = Object(static_cast<Stream *>(mem_stream));
+
+ Ref r = xref->addIndirectObject(&stream);
+
+ /* Update Xref table */
+ Object obj_ref = Object(r.num, r.gen);
+
+ /*
+ * Fill Annotation's appearance streams dic /AP
+ * See: 8.4.4 Appearance Streams
+ */
+ Object appearance_streams_dic = Object(new Dict(xref));
+ appearance_streams_dic.dictSet("N", std::move(obj_ref));
+
+ field_obj->getDict()->set("AP", std::move(appearance_streams_dic));
+#else
array.initArray(xref);
Object el;
el.initReal(0);
@@ -705,6 +907,7 @@
appearance_streams_dic.dictSet("N", &obj_ref);
field_obj->getDict()->set("AP", &appearance_streams_dic);
+#endif
/* Notify poppler about changes */
xref->setModifiedObject(field_obj, field_ref);
@@ -721,24 +924,38 @@
* OpenOffice - by default sets it to 'true'.
*/
Object *obj_form = catalog->getAcroForm();
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ obj_form->dictSet("NeedAppearances", Object(gFalse));
+#else
Object obj1;
obj1.initBool(gFalse);
obj_form->dictSet("NeedAppearances", &obj1);
+#endif
+
/* Add AccroForm as indirect obj */
Ref ref_form = xref->addIndirectObject(obj_form);
/*
* So update Catalog object.
*/
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ Object catObj = xref->getCatalog();
+#else
Object* catObj = new Object();
catObj = xref->getCatalog(catObj);
+#endif
Ref catRef;
catRef.gen = xref->getRootGen();
catRef.num = xref->getRootNum();
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ catObj.dictSet("AcroForm", Object(ref_form.num, ref_form.gen));
+ xref->setModifiedObject(&catObj, catRef);
+#else
Object obj2;
obj2.initRef(ref_form.num, ref_form.gen);
catObj->dictSet("AcroForm", &obj2);
xref->setModifiedObject(catObj, catRef);
+#endif
/* Success */
return 1;
@@ -780,7 +997,11 @@
/* Font dictionary object for embeded font */
Object f_dic;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ f_dic = Object(new Dict(xref));
+#else
f_dic.initDict(xref);
+#endif
f_dic.dictSet("Type", name_object("Font"));
/* Stream lenght */
@@ -798,12 +1019,18 @@
}
/* Create memory stream font. Add it to font dic. */
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ MemStream *mem_stream = new MemStream(font_stream->getCString(),
+ 0, outlen, std::move(f_dic));
+ Object stream = Object(static_cast<Stream *>(mem_stream));
+#else
MemStream *mem_stream = new MemStream(font_stream->getCString(),
0, outlen, &f_dic);
/* Make obj stream */
Object stream;
stream.initStream(mem_stream);
+#endif
Ref r;
@@ -813,7 +1040,11 @@
/* Get page object */
Object pageobj;
Ref pageref = page->getRef();
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ pageobj = xref->fetch(pageref.num, pageref.gen);
+#else
xref->fetch(pageref.num, pageref.gen, &pageobj);
+#endif
if (!pageobj.isDict()) {
fprintf(stderr, "Error: malformed pdf.\n");
return 0;
@@ -825,18 +1056,29 @@
Object *ret = get_resource_dict(xref, pageobj.getDict(), &resdict, &resref);
if ( !ret ) {
fprintf(stderr, "Error: malformed pdf\n");
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
pageobj.free();
+#endif
return 0;
}
/* Dictionary for all fonts in page's resources */
Object fonts;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ fonts = resdict.dictLookupNF("Font");
+#else
resdict.dictLookupNF("Font", &fonts);
+#endif
if (fonts.isNull()) {
/* Create new one, if doesn't exists */
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ resdict.dictSet("Font", Object(new Dict(xref)));
+ fonts = resdict.dictLookupNF("Font");
+#else
fonts.initDict(xref);
resdict.dictSet("Font", &fonts);
+#endif
fprintf(stderr, "Create new font dict in page's resources.\n");
}
@@ -866,7 +1108,11 @@
/* r - cid resource dic */
Object font_res_obj_ref;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ font_res_obj_ref = Object(r.num, r.gen);
+#else
font_res_obj_ref.initRef(r.num, r.gen);
+#endif
Object *fonts_dic;
Object dereferenced_obj;
@@ -876,7 +1122,11 @@
fonts_dic = &fonts;
} else if ( fonts.isRef() ) {
/* "Font" resource is indirect reference object */
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ dereferenced_obj = xref->fetch(fonts.getRefNum(), fonts.getRefGen());
+#else
xref->fetch(fonts.getRefNum(), fonts.getRefGen(), &dereferenced_obj);
+#endif
fonts_dic = &dereferenced_obj;
}
@@ -886,7 +1136,11 @@
}
/* Add to fonts dic new font */
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ fonts_dic->dictSet("stanv_font", std::move(font_res_obj_ref));
+#else
fonts_dic->dictSet("stanv_font", &font_res_obj_ref);
+#endif
/* Notify poppler about changes in fonts dic */
if ( fonts.isRef() ) {
@@ -897,7 +1151,9 @@
xref->setModifiedObject(&resdict, resref);
fprintf(stderr, "Resource dict was changed.\n");
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
pageobj.free();
+#endif
/* Success */
return 1;
@@ -1104,8 +1360,12 @@
XRef *xref = doc->getXRef();
/* Font dictionary for embeded font */
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ Object *dic = new Object(new Dict(xref));
+#else
Object *dic = new Object();
dic->initDict(xref);
+#endif
dic->dictSet("Type", name_object("FontDescriptor"));
dic->dictSet(
@@ -1119,6 +1379,15 @@
dic->dictSet("StemV", int_object(fdes->stemV));
/* FontBox array */
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ Object array = Object(new Array(xref));
+ array.arrayAdd(Object(static_cast<double>(fdes->bbxmin)));
+ array.arrayAdd(Object(static_cast<double>(fdes->bbymin)));
+ array.arrayAdd(Object(static_cast<double>(fdes->bbxmax)));
+ array.arrayAdd(Object(static_cast<double>(fdes->bbymax)));
+
+ dic->dictSet("FontBBox", std::move(array));
+#else
Object array;
array.initArray(xref);
@@ -1137,6 +1406,7 @@
array.arrayAdd(&el);
dic->dictSet("FontBBox", &array);
+#endif
if (fdes->xHeight) {
dic->dictSet("XHeight", int_object(fdes->xHeight));
@@ -1149,20 +1419,34 @@
if (fdes->panose) {
/* Font dictionary for embeded font */
Object style_dic;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ style_dic = Object(new Dict(xref));
+#else
style_dic.initDict(xref);
-
+#endif
+
+ GooString *panose_str = new GooString(fdes->panose, 12);
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ style_dic.dictSet("Panose", Object(panose_str));
+
+ dic->dictSet("Style", std::move(style_dic));
+#else
Object panose;
- GooString *panose_str = new GooString(fdes->panose, 12);
panose.initString(panose_str);
style_dic.dictSet("Panose", &panose);
dic->dictSet("Style", &style_dic);
+#endif
}
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ dic->dictSet(emb_pdf_get_fontfile_key(emb), Object(fontfile_obj_ref.num, fontfile_obj_ref.gen));
+#else
Object ref_obj;
ref_obj.initRef(fontfile_obj_ref.num, fontfile_obj_ref.gen);
dic->dictSet(emb_pdf_get_fontfile_key(emb), &ref_obj);
+#endif
return dic;
}
@@ -1181,8 +1465,12 @@
/* Get XREF table */
XRef *xref = doc->getXRef();
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ Object *dic = new Object(new Dict(xref));
+#else
Object *dic = new Object();
dic->initDict(xref);
+#endif
dic->dictSet("Type", name_object("Font"));
dic->dictSet(
@@ -1192,15 +1480,23 @@
"BaseFont",
name_object(copyString(emb_pdf_escape_name(fdes->fontname,-1))));
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ dic->dictSet("FontDescriptor", Object(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen));
+#else
Object ref_obj;
ref_obj.initRef(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen);
dic->dictSet("FontDescriptor", &ref_obj);
+#endif
if ( emb->plan & EMB_A_MULTIBYTE ) {
assert(fwid->warray);
Object CIDSystemInfo_dic;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ CIDSystemInfo_dic = Object(new Dict(xref));
+#else
CIDSystemInfo_dic.initDict(xref);
+#endif
Object registry;
Object ordering;
@@ -1208,16 +1504,28 @@
GooString *str;
str = new GooString(copyString(fdes->registry));
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ CIDSystemInfo_dic.dictSet("Registry", Object(str));
+#else
registry.initString(str);
CIDSystemInfo_dic.dictSet("Registry", &registry);
+#endif
str = new GooString(copyString(fdes->ordering));
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ CIDSystemInfo_dic.dictSet("Ordering", Object(str));
+#else
ordering.initString(str);
CIDSystemInfo_dic.dictSet("Ordering", &ordering);
+#endif
CIDSystemInfo_dic.dictSet("Supplement", int_object(fdes->supplement));
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ dic->dictSet("CIDSystemInfo", std::move(CIDSystemInfo_dic));
+#else
dic->dictSet("CIDSystemInfo", &CIDSystemInfo_dic);
+#endif
dic->dictSet("DW", int_object(fwid->default_width));
}
@@ -1249,8 +1557,12 @@
/* Get XREF table */
XRef *xref = doc->getXRef();
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ Object *dic = new Object(new Dict(xref));
+#else
Object *dic = new Object();
dic->initDict(xref);
+#endif
dic->dictSet("Type", name_object("Font"));
dic->dictSet("Subtype", name_object("Type0"));
@@ -1267,13 +1579,24 @@
dic->dictSet("Encoding", name_object(copyString(encoding)));
Object obj;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ obj = Object(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen);
+#else
obj.initRef(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen);
+#endif
Object array;
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
+ array = Object(new Array(xref));
+ array.arrayAdd(std::move(obj));
+
+ dic->dictSet("DescendantFonts", std::move(array));
+#else
array.initArray(xref);
array.arrayAdd(&obj);
dic->dictSet("DescendantFonts", &array);
+#endif
return dic;
}

View File

@ -1,28 +0,0 @@
From 07a0a423a8469a2dd6d7f64bb3b62ba6ac42cc28 Mon Sep 17 00:00:00 2001
From: Lars Wendler <polynomial-c@gentoo.org>
Date: Fri, 20 Jul 2018 15:20:11 +0200
Subject: [PATCH] GooString needs to be const since >=poppler-0.64.0
This only fails with >=poppler-0.67.0 but the change to const was done
in 0.64.0
---
filter/pdf.cxx | 3 +++
1 file changed, 3 insertions(+)
diff --git a/filter/pdf.cxx b/filter/pdf.cxx
index 206ccf88..665eab09 100644
--- a/filter/pdf.cxx
+++ b/filter/pdf.cxx
@@ -734,6 +734,9 @@ extern "C" int pdf_fill_form(pdf_t *doc, opt_t *opt)
}
FormField *ff = fm_text->getField();
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 64
+ const
+#endif
GooString *field_name;
field_name = ff->getFullyQualifiedName();
if ( ! field_name )
--
2.17.1

View File

@ -1 +1 @@
SHA512 (cups-filters-1.20.3.tar.xz) = 402a53bf1ea12b14e6f8aa46f8f5e91b2caf9da3a8f14759568b5a45b9309f379fec542c843da5560cbcec2c4860babfee7e9c2f0c62f5fa6254025e9d867b31
SHA512 (cups-filters-1.21.2.tar.xz) = 07672737108e1593374fa95582e2c8ad7a3fec6202846ba85224c1c89f65b7b89de96ebf67841ec5d948fe556dddd06ae6a58ad6c5c0a25a82ce643c9384aaf0