Hello community, here is the log from the commit of package poppler for openSUSE:Factory checked in at 2017-01-25 22:31:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/poppler (Old) and /work/SRC/openSUSE:Factory/.poppler.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "poppler" Changes: -------- --- /work/SRC/openSUSE:Factory/poppler/poppler-qt.changes 2016-12-26 21:41:50.921782919 +0100 +++ /work/SRC/openSUSE:Factory/.poppler.new/poppler-qt.changes 2017-01-25 22:31:05.280242473 +0100 @@ -1,0 +2,16 @@ +Tue Jan 17 10:47:23 UTC 2017 - [email protected] + +- Update to version 0.51.0: + + core: + - Check for error from NSS in SignatureHandler construct + (fdo#99363). + - Add Form[Field|Widget]::setPartialName + - Fix memory leak in PDFDoc::markAnnotations. + + qt5: + - Implement digital signature support. Bug #94378 + - Add Poppler::FormField::setName + - Fix segfault/assert if LinkDestination is constructed with + invalid input string (fdo#99357). + + utils: pdfunite: add fields to AcroForm dict (fdo#99141). + +------------------------------------------------------------------- poppler-qt5.changes: same change poppler.changes: same change Old: ---- poppler-0.50.0.tar.xz New: ---- poppler-0.51.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ poppler-qt.spec ++++++ --- /var/tmp/diff_new_pack.S74SFW/_old 2017-01-25 22:31:06.120115320 +0100 +++ /var/tmp/diff_new_pack.S74SFW/_new 2017-01-25 22:31:06.124114715 +0100 @@ -1,7 +1,7 @@ # # spec file for package poppler-qt # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,7 +21,7 @@ Name: poppler-qt %define _name poppler -Version: 0.50.0 +Version: 0.51.0 Release: 0 # Actual version of poppler-data: %define poppler_data_version 0.4.6 poppler-qt5.spec: same change ++++++ poppler.spec ++++++ --- /var/tmp/diff_new_pack.S74SFW/_old 2017-01-25 22:31:06.188105027 +0100 +++ /var/tmp/diff_new_pack.S74SFW/_new 2017-01-25 22:31:06.192104421 +0100 @@ -1,7 +1,7 @@ # # spec file for package poppler # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,7 +21,7 @@ Name: poppler %define _name poppler -Version: 0.50.0 +Version: 0.51.0 Release: 0 # Actual version of poppler-data: %define poppler_data_version 0.4.6 ++++++ poppler-0.50.0.tar.xz -> poppler-0.51.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/CMakeLists.txt new/poppler-0.51.0/CMakeLists.txt --- old/poppler-0.50.0/CMakeLists.txt 2016-12-15 22:31:34.000000000 +0100 +++ new/poppler-0.51.0/CMakeLists.txt 2017-01-15 18:23:54.000000000 +0100 @@ -22,7 +22,7 @@ endif() set(POPPLER_MAJOR_VERSION "0") -set(POPPLER_MINOR_VERSION "50") +set(POPPLER_MINOR_VERSION "51") set(POPPLER_MICRO_VERSION "0") set(POPPLER_VERSION "${POPPLER_MAJOR_VERSION}.${POPPLER_MINOR_VERSION}.${POPPLER_MICRO_VERSION}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/ChangeLog new/poppler-0.51.0/ChangeLog --- old/poppler-0.50.0/ChangeLog 2016-12-15 23:40:28.000000000 +0100 +++ new/poppler-0.51.0/ChangeLog 2017-01-15 18:44:31.000000000 +0100 @@ -1,4 +1,132 @@ -commit 281f3a2ec4be515a8876a66575341f404a6a0208 +commit dc8edecc437f33305257b6cb208dc2da367b7868 +Author: Albert Astals Cid <[email protected]> +Date: Sun Jan 15 18:27:49 2017 +0100 + + Poppler 0.51 + + CMakeLists.txt | 2 +- + NEWS | 15 ++++++++++++++- + configure.ac | 2 +- + cpp/Doxyfile | 2 +- + qt4/src/Doxyfile | 2 +- + qt5/src/CMakeLists.txt | 2 +- + qt5/src/Doxyfile | 2 +- + qt5/src/Makefile.am | 2 +- + 8 files changed, 21 insertions(+), 8 deletions(-) + +commit c4de00a93c470020c6c96eb343854039bfc0a424 +Author: Albert Astals Cid <[email protected]> +Date: Sat Jan 14 23:42:32 2017 +0100 + + Forgot to update the \since value + + qt5/src/poppler-form.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 0eb28e216fc45fe5ceed1c093a541ceca0dc0397 +Author: Christoph Cullmann <[email protected]> +Date: Fri Jan 13 00:03:27 2017 +0100 + + qt5: Fix segfault/assert if LinkDestination is constructed with + invalid input string. + + Bug #99357 + + qt5/src/poppler-link.cc | 24 +++++++++++++----------- + 1 file changed, 13 insertions(+), 11 deletions(-) + +commit 4db6507320b51e060f73f7fb0eab364e8a1fee77 +Author: Sebastian Rasmussen <[email protected]> +Date: Wed Jan 11 23:37:54 2017 +0100 + + Check for error from NSS in SignatureHandler construct. + + And cascading effects in other SignalHandler members. + + Bug #99363 + + poppler/SignatureHandler.cc | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +commit 8bb90fc828a3400a2464a38f0ec9e592754197dd +Author: Albert Astals Cid <[email protected]> +Date: Tue Jan 10 17:20:18 2017 +0100 + + Qt5: Minor api refinements to the new signature classes + + qt5/src/poppler-form.cc | 32 +++++++++++++++++++++----------- + qt5/src/poppler-form.h | 22 +++++++++++----------- + qt5/tests/poppler-forms.cpp | 14 +++++++------- + 3 files changed, 39 insertions(+), 29 deletions(-) + +commit aa63debdaa6001ed68333b31cd06c2f9958fd8d2 +Author: Hanno Meyer-Thurow <[email protected]> +Date: Tue Jan 10 16:28:14 2017 +0100 + + Qt5: Implement digital signature support + + Bug #94378 + + qt5/src/poppler-form.cc | 121 + ++++++++++++++++++++++++++++++++++++++++++++ + qt5/src/poppler-form.h | 106 ++++++++++++++++++++++++++++++++++++++ + qt5/src/poppler-page.cc | 7 +++ + qt5/tests/poppler-forms.cpp | 47 ++++++++++++++++- + 4 files changed, 280 insertions(+), 1 deletion(-) + +commit 2f831d5b9481e5ab06178409f7fccf74eda6e1a2 +Author: Albert Astals Cid <[email protected]> +Date: Mon Jan 9 00:30:42 2017 +0100 + + New year! + + poppler/poppler-config.h.cmake | 2 +- + poppler/poppler-config.h.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit b6c4d6d1312f63e5e6dcfa28ea48ff3e6935daa9 +Author: Albert Astals Cid <[email protected]> +Date: Mon Jan 9 00:28:37 2017 +0100 + + Fix memory leak in PDFDoc::markAnnotations + + poppler/PDFDoc.cc | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +commit 3cae7773d2f8ad6506e2712689c56fa6975e01d3 +Author: Thomas Freitag <[email protected]> +Date: Mon Jan 9 00:25:53 2017 +0100 + + pdfunite: add fields to AcroForm dict + + Bug #99141 + + utils/pdfunite.cc | 33 +++++++++++++++++++++++++++++++-- + 1 file changed, 31 insertions(+), 2 deletions(-) + +commit c301f6c675784a65fb2ebdf99ded5d5d3f8defdd +Author: Albert Astals Cid <[email protected]> +Date: Mon Dec 19 22:53:47 2016 +0100 + + qt5: Add Poppler::FormField::setName + + qt5/src/poppler-form.cc | 9 ++++++++- + qt5/src/poppler-form.h | 10 ++++++++-- + 2 files changed, 16 insertions(+), 3 deletions(-) + +commit 86c99de95cd16199e0f9f1fb82999c27d54c5b76 +Author: Albert Astals Cid <[email protected]> +Date: Mon Dec 19 22:53:10 2016 +0100 + + Add Form[Field|Widget]::setPartialName + + Useful to repair/tweak pdf files + + poppler/Form.cc | 16 ++++++++++++++++ + poppler/Form.h | 2 ++ + 2 files changed, 18 insertions(+) + +commit 56dfa44960b9ab9fb4dcc01d8e3861a9293b0ee0 Author: Albert Astals Cid <[email protected]> Date: Thu Dec 15 23:32:41 2016 +0100 @@ -11,11 +139,11 @@ poppler/Makefile.am | 2 +- qt4/src/CMakeLists.txt | 2 +- qt4/src/Doxyfile | 2 +- - qt4/src/Makefile.am | 2 +- + qt4/src/Makefile.am | 3 ++- qt5/src/CMakeLists.txt | 2 +- qt5/src/Doxyfile | 2 +- - qt5/src/Makefile.am | 2 +- - 11 files changed, 36 insertions(+), 11 deletions(-) + qt5/src/Makefile.am | 3 ++- + 11 files changed, 38 insertions(+), 11 deletions(-) commit 1511523450f40b539fb1d58950a907f3712fd5c7 Author: Albert Astals Cid <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/NEWS new/poppler-0.51.0/NEWS --- old/poppler-0.50.0/NEWS 2016-12-15 22:30:32.000000000 +0100 +++ new/poppler-0.51.0/NEWS 2017-01-15 18:24:25.000000000 +0100 @@ -1,3 +1,17 @@ +Release 0.51.0 + core: + * Check for error from NSS in SignatureHandler construct. Bug #99363 + * Add Form[Field|Widget]::setPartialName + * Fix memory leak in PDFDoc::markAnnotations + + qt5: + * Implement digital signature support. Bug #94378 + * Add Poppler::FormField::setName + * Fix segfault/assert if LinkDestination is constructed with invalid input string. Bug #99357 + + utils: + * pdfunite: add fields to AcroForm dict. Bug #99141 + Release 0.50.0 core: * PSOutputDev: Fix PS conversion for some files. Bug #63963 @@ -22,7 +36,6 @@ glib: * Use g_slice_new0 for PopplerActionLayer. Bug #98786 - Release 0.49.0 core: * Merge type3 glyph handling from xpdf 3.04. Bug #96667 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/configure new/poppler-0.51.0/configure --- old/poppler-0.50.0/configure 2016-12-15 23:36:32.000000000 +0100 +++ new/poppler-0.51.0/configure 2017-01-15 18:29:46.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for poppler 0.50.0. +# Generated by GNU Autoconf 2.69 for poppler 0.51.0. # # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=poppler>. # @@ -591,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='poppler' PACKAGE_TARNAME='poppler' -PACKAGE_VERSION='0.50.0' -PACKAGE_STRING='poppler 0.50.0' +PACKAGE_VERSION='0.51.0' +PACKAGE_STRING='poppler 0.51.0' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=poppler' PACKAGE_URL='' @@ -1554,7 +1554,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures poppler 0.50.0 to adapt to many kinds of systems. +\`configure' configures poppler 0.51.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1629,7 +1629,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of poppler 0.50.0:";; + short | recursive ) echo "Configuration of poppler 0.51.0:";; esac cat <<\_ACEOF @@ -1860,7 +1860,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -poppler configure 0.50.0 +poppler configure 0.51.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2554,7 +2554,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by poppler $as_me 0.50.0, which was +It was created by poppler $as_me 0.51.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3418,7 +3418,7 @@ # Define the identity of the package. PACKAGE='poppler' - VERSION='0.50.0' + VERSION='0.51.0' cat >>confdefs.h <<_ACEOF @@ -18500,7 +18500,7 @@ cat >>confdefs.h <<_ACEOF -#define POPPLER_VERSION "0.50.0" +#define POPPLER_VERSION "0.51.0" _ACEOF @@ -25820,11 +25820,11 @@ POPPLER_MAJOR_VERSION=0 -POPPLER_MINOR_VERSION=50 +POPPLER_MINOR_VERSION=51 POPPLER_MICRO_VERSION=0 -POPPLER_VERSION=0.50.0 +POPPLER_VERSION=0.51.0 ac_config_files="$ac_config_files Makefile goo/Makefile fofi/Makefile splash/Makefile poppler/Makefile utils/Makefile glib/Makefile glib/poppler-features.h glib/reference/Makefile glib/reference/version.xml glib/demo/Makefile test/Makefile qt4/Makefile qt4/src/Makefile qt4/tests/Makefile qt4/demos/Makefile qt5/Makefile qt5/src/Makefile qt5/tests/Makefile qt5/demos/Makefile cpp/Makefile cpp/poppler-version.h cpp/tests/Makefile poppler.pc poppler-uninstalled.pc poppler-cairo.pc poppler-cairo-uninstalled.pc poppler-splash.pc poppler-splash-uninstalled.pc poppler-glib.pc poppler-glib-uninstalled.pc poppler-qt4.pc poppler-qt4-uninstalled.pc poppler-qt5.pc poppler-qt5-uninstalled.pc poppler-cpp.pc poppler-cpp-uninstalled.pc" @@ -26484,7 +26484,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by poppler $as_me 0.50.0, which was +This file was extended by poppler $as_me 0.51.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26550,7 +26550,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -poppler config.status 0.50.0 +poppler config.status 0.51.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/configure.ac new/poppler-0.51.0/configure.ac --- old/poppler-0.50.0/configure.ac 2016-12-15 22:30:56.000000000 +0100 +++ new/poppler-0.51.0/configure.ac 2017-01-15 18:23:40.000000000 +0100 @@ -1,5 +1,5 @@ m4_define([poppler_version_major],[0]) -m4_define([poppler_version_minor],[50]) +m4_define([poppler_version_minor],[51]) m4_define([poppler_version_micro],[0]) m4_define([poppler_version],[poppler_version_major.poppler_version_minor.poppler_version_micro]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/cpp/poppler-version.h new/poppler-0.51.0/cpp/poppler-version.h --- old/poppler-0.50.0/cpp/poppler-version.h 2016-12-15 23:36:40.000000000 +0100 +++ new/poppler-0.51.0/cpp/poppler-version.h 2017-01-15 18:30:00.000000000 +0100 @@ -21,9 +21,9 @@ #include "poppler-global.h" -#define POPPLER_VERSION "0.50.0" +#define POPPLER_VERSION "0.51.0" #define POPPLER_VERSION_MAJOR 0 -#define POPPLER_VERSION_MINOR 50 +#define POPPLER_VERSION_MINOR 51 #define POPPLER_VERSION_MICRO 0 namespace poppler diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/glib/reference/html/index.html new/poppler-0.51.0/glib/reference/html/index.html --- old/poppler-0.50.0/glib/reference/html/index.html 2016-12-15 23:41:02.000000000 +0100 +++ new/poppler-0.51.0/glib/reference/html/index.html 2017-01-15 18:44:32.000000000 +0100 @@ -15,7 +15,7 @@ <div> <div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">Poppler Reference Manual</p></th></tr></table></div> <div><p class="releaseinfo"> - for Poppler 0.50.0 + for Poppler 0.51.0 </p></div> </div> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/glib/reference/html/poppler-Version-and-Features-Information.html new/poppler-0.51.0/glib/reference/html/poppler-Version-and-Features-Information.html --- old/poppler-0.50.0/glib/reference/html/poppler-Version-and-Features-Information.html 2016-12-15 23:41:02.000000000 +0100 +++ new/poppler-0.51.0/glib/reference/html/poppler-Version-and-Features-Information.html 2017-01-15 18:44:32.000000000 +0100 @@ -189,7 +189,7 @@ <hr> <div class="refsect2"> <a name="POPPLER-MINOR-VERSION:CAPS"></a><h3>POPPLER_MINOR_VERSION</h3> -<pre class="programlisting">#define POPPLER_MINOR_VERSION (50) +<pre class="programlisting">#define POPPLER_MINOR_VERSION (51) </pre> <p>The major version number of the poppler header files (e.g. in poppler version 0.1.2 this is 1.)</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/glib/reference/version.xml new/poppler-0.51.0/glib/reference/version.xml --- old/poppler-0.50.0/glib/reference/version.xml 2016-12-15 23:36:40.000000000 +0100 +++ new/poppler-0.51.0/glib/reference/version.xml 2017-01-15 18:30:00.000000000 +0100 @@ -1 +1 @@ -0.50.0 +0.51.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/poppler/Form.cc new/poppler-0.51.0/poppler/Form.cc --- old/poppler-0.50.0/poppler/Form.cc 2016-12-15 20:08:06.000000000 +0100 +++ new/poppler-0.51.0/poppler/Form.cc 2016-12-19 22:52:42.000000000 +0100 @@ -147,6 +147,11 @@ return field->getPartialName(); } +void FormWidget::setPartialName(const GooString &name) +{ + field->setPartialName(name); +} + GooString *FormWidget::getAlternateUiName() const { return field->getAlternateUiName(); } @@ -611,6 +616,17 @@ obj1.free(); } +void FormField::setPartialName(const GooString &name) +{ + delete partialName; + partialName = name.copy(); + + Object obj1; + obj1.initString(name.copy()); + obj.getDict()->set("T", &obj1); + xref->setModifiedObject(&obj, ref); +} + FormField::~FormField() { if (!terminal) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/poppler/Form.h new/poppler-0.51.0/poppler/Form.h --- old/poppler-0.50.0/poppler/Form.h 2016-12-15 20:08:06.000000000 +0100 +++ new/poppler-0.51.0/poppler/Form.h 2016-12-19 00:00:32.000000000 +0100 @@ -98,6 +98,7 @@ double getFontSize() const; GooString *getPartialName() const; + void setPartialName(const GooString &name); GooString *getAlternateUiName() const; GooString *getMappingName() const; GooString *getFullyQualifiedName(); @@ -279,6 +280,7 @@ VariableTextQuadding getTextQuadding() const { return quadding; } GooString *getPartialName() const { return partialName; } + void setPartialName(const GooString &name); GooString *getAlternateUiName() const { return alternateUiName; } GooString *getMappingName() const { return mappingName; } GooString *getFullyQualifiedName(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/poppler/PDFDoc.cc new/poppler-0.51.0/poppler/PDFDoc.cc --- old/poppler-0.50.0/poppler/PDFDoc.cc 2016-12-15 20:08:06.000000000 +0100 +++ new/poppler-0.51.0/poppler/PDFDoc.cc 2017-01-09 00:28:47.000000000 +0100 @@ -14,7 +14,7 @@ // under GPL version 2 or later // // Copyright (C) 2005, 2006, 2008 Brad Hards <[email protected]> -// Copyright (C) 2005, 2007-2009, 2011-2016 Albert Astals Cid <[email protected]> +// Copyright (C) 2005, 2007-2009, 2011-2017 Albert Astals Cid <[email protected]> // Copyright (C) 2008 Julien Rebetez <[email protected]> // Copyright (C) 2008, 2010 Pino Toscano <[email protected]> // Copyright (C) 2008, 2010, 2011 Carlos Garcia Campos <[email protected]> @@ -1735,9 +1735,9 @@ Object obj3; array->getNF(i, &obj3); if (obj3.isRef()) { - Object *newRef = new Object(); - newRef->initRef(newPageNum, 0); - dict->set("P", newRef); + Object newRef; + newRef.initRef(newPageNum, 0); + dict->set("P", &newRef); getXRef()->setModifiedObject(&obj1, obj3.getRef()); } obj3.free(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/poppler/SignatureHandler.cc new/poppler-0.51.0/poppler/SignatureHandler.cc --- old/poppler-0.50.0/poppler/SignatureHandler.cc 2016-12-06 23:48:27.000000000 +0100 +++ new/poppler-0.51.0/poppler/SignatureHandler.cc 2017-01-11 23:42:49.000000000 +0100 @@ -8,6 +8,7 @@ // Copyright 2015 André Esser <[email protected]> // Copyright 2015, 2016 Albert Astals Cid <[email protected]> // Copyright 2015 Markus Kilås <[email protected]> +// Copyright 2017 Sebastian Rasmussen <[email protected]> // //======================================================================== @@ -105,7 +106,8 @@ SignatureHandler::SignatureHandler(unsigned char *p7, int p7_length) - : CMSMessage(NULL), + : hash_context(NULL), + CMSMessage(NULL), CMSSignedData(NULL), CMSSignerInfo(NULL), temp_certs(NULL) @@ -115,8 +117,10 @@ CMSitem.len = p7_length; CMSMessage = CMS_MessageCreate(&CMSitem); CMSSignedData = CMS_SignedDataCreate(CMSMessage); - CMSSignerInfo = CMS_SignerInfoCreate(CMSSignedData); - hash_context = initHashContext(); + if (CMSSignedData) { + CMSSignerInfo = CMS_SignerInfoCreate(CMSSignedData); + hash_context = initHashContext(); + } } HASHContext * SignatureHandler::initHashContext() @@ -131,7 +135,9 @@ void SignatureHandler::updateHash(unsigned char * data_block, int data_len) { - HASH_Update(hash_context, data_block, data_len); + if (hash_context) { + HASH_Update(hash_context, data_block, data_len); + } } SignatureHandler::~SignatureHandler() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/poppler/poppler-config.h.cmake new/poppler-0.51.0/poppler/poppler-config.h.cmake --- old/poppler-0.50.0/poppler/poppler-config.h.cmake 2016-12-15 20:08:06.000000000 +0100 +++ new/poppler-0.51.0/poppler/poppler-config.h.cmake 2017-01-09 00:30:37.000000000 +0100 @@ -135,7 +135,7 @@ //------------------------------------------------------------------------ // copyright notice -#define popplerCopyright "Copyright 2005-2016 The Poppler Developers - http://poppler.freedesktop.org" +#define popplerCopyright "Copyright 2005-2017 The Poppler Developers - http://poppler.freedesktop.org" #define xpdfCopyright "Copyright 1996-2011 Glyph & Cog, LLC" //------------------------------------------------------------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/poppler/poppler-config.h.in new/poppler-0.51.0/poppler/poppler-config.h.in --- old/poppler-0.50.0/poppler/poppler-config.h.in 2016-12-15 20:08:06.000000000 +0100 +++ new/poppler-0.51.0/poppler/poppler-config.h.in 2017-01-09 00:30:32.000000000 +0100 @@ -135,7 +135,7 @@ //------------------------------------------------------------------------ // copyright notice -#define popplerCopyright "Copyright 2005-2016 The Poppler Developers - http://poppler.freedesktop.org" +#define popplerCopyright "Copyright 2005-2017 The Poppler Developers - http://poppler.freedesktop.org" #define xpdfCopyright "Copyright 1996-2011 Glyph & Cog, LLC" //------------------------------------------------------------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/qt5/src/CMakeLists.txt new/poppler-0.51.0/qt5/src/CMakeLists.txt --- old/poppler-0.50.0/qt5/src/CMakeLists.txt 2016-12-15 22:32:12.000000000 +0100 +++ new/poppler-0.51.0/qt5/src/CMakeLists.txt 2017-01-15 18:26:06.000000000 +0100 @@ -30,7 +30,7 @@ ArthurOutputDev.cc ) add_library(poppler-qt5 SHARED ${poppler_qt5_SRCS}) -set_target_properties(poppler-qt5 PROPERTIES VERSION 1.8.0 SOVERSION 1) +set_target_properties(poppler-qt5 PROPERTIES VERSION 1.9.0 SOVERSION 1) target_link_libraries(poppler-qt5 poppler ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Xml_LIBRARIES}) if(MSVC) target_link_libraries(poppler-qt5 poppler ${poppler_LIBS}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/qt5/src/Makefile.am new/poppler-0.51.0/qt5/src/Makefile.am --- old/poppler-0.50.0/qt5/src/Makefile.am 2016-12-15 23:35:28.000000000 +0100 +++ new/poppler-0.51.0/qt5/src/Makefile.am 2017-01-15 18:26:37.000000000 +0100 @@ -61,7 +61,7 @@ $(POPPLER_QT5_LIBS) libpoppler_qt5_la_LDFLAGS = \ - -version-info 9:0:8 \ + -version-info 10:0:9 \ @create_shared_lib@ \ @auto_import_flags@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/qt5/src/Makefile.in new/poppler-0.51.0/qt5/src/Makefile.in --- old/poppler-0.50.0/qt5/src/Makefile.in 2016-12-15 23:36:31.000000000 +0100 +++ new/poppler-0.51.0/qt5/src/Makefile.in 2017-01-15 18:29:48.000000000 +0100 @@ -525,7 +525,7 @@ $(POPPLER_QT5_LIBS) libpoppler_qt5_la_LDFLAGS = \ - -version-info 9:0:8 \ + -version-info 10:0:9 \ @create_shared_lib@ \ @auto_import_flags@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/qt5/src/poppler-form.cc new/poppler-0.51.0/qt5/src/poppler-form.cc --- old/poppler-0.50.0/qt5/src/poppler-form.cc 2016-12-07 01:38:42.000000000 +0100 +++ new/poppler-0.51.0/qt5/src/poppler-form.cc 2017-01-11 23:42:48.000000000 +0100 @@ -1,8 +1,9 @@ /* poppler-form.h: qt interface to poppler * Copyright (C) 2007-2008, 2011, Pino Toscano <[email protected]> - * Copyright (C) 2008, 2011, 2012, 2015 Albert Astals Cid <[email protected]> + * Copyright (C) 2008, 2011, 2012, 2015-2017 Albert Astals Cid <[email protected]> * Copyright (C) 2011 Carlos Garcia Campos <[email protected]> * Copyright (C) 2012, Adam Reichold <[email protected]> + * Copyright (C) 2016, Hanno Meyer-Thurow <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +27,7 @@ #include <Form.h> #include <Object.h> #include <Link.h> +#include <SignatureInfo.h> #include "poppler-form.h" #include "poppler-page-private.h" @@ -111,6 +113,13 @@ return name; } +void FormField::setName(const QString &name) const +{ + GooString * goo = QStringToGooString( name ); + m_formData->fm->setPartialName(*goo); + delete goo; +} + QString FormField::fullyQualifiedName() const { QString name; @@ -414,4 +423,133 @@ return !fwc->noSpellCheck(); } + +struct SignatureValidationInfoPrivate { + SignatureValidationInfo::SignatureStatus signature_status; + SignatureValidationInfo::CertificateStatus certificate_status; + + QString signer_name; + time_t signing_time; +}; + + +SignatureValidationInfo::SignatureValidationInfo(SignatureValidationInfoPrivate* priv) + : d_ptr(priv) +{ +} + +SignatureValidationInfo::SignatureValidationInfo(const SignatureValidationInfo &other) + : d_ptr( other.d_ptr ) +{ +} + +SignatureValidationInfo::~SignatureValidationInfo() +{ +} + +SignatureValidationInfo::SignatureStatus SignatureValidationInfo::signatureStatus() const +{ + Q_D(const SignatureValidationInfo); + return d->signature_status; +} + +SignatureValidationInfo::CertificateStatus SignatureValidationInfo::certificateStatus() const +{ + Q_D(const SignatureValidationInfo); + return d->certificate_status; +} + +QString SignatureValidationInfo::signerName() const +{ + Q_D(const SignatureValidationInfo); + return d->signer_name; +} + +time_t SignatureValidationInfo::signingTime() const +{ + Q_D(const SignatureValidationInfo); + return d->signing_time; +} + +SignatureValidationInfo &SignatureValidationInfo::operator=(const SignatureValidationInfo &other) +{ + if ( this != &other ) + d_ptr = other.d_ptr; + + return *this; +} + +FormFieldSignature::FormFieldSignature(DocumentData *doc, ::Page *p, ::FormWidgetSignature *w) + : FormField(*new FormFieldData(doc, p, w)) +{ +} + +FormFieldSignature::~FormFieldSignature() +{ +} + +FormField::FormType FormFieldSignature::type() const +{ + return FormField::FormSignature; +} + +SignatureValidationInfo FormFieldSignature::validate(ValidateOptions opt) const +{ + FormWidgetSignature* fws = static_cast<FormWidgetSignature*>(m_formData->fm); + SignatureInfo* si = fws->validateSignature(opt & ValidateVerifyCertificate, opt & ValidateForceRevalidation); + SignatureValidationInfoPrivate* priv = new SignatureValidationInfoPrivate; + switch (si->getSignatureValStatus()) { + case SIGNATURE_VALID: + priv->signature_status = SignatureValidationInfo::SignatureValid; + break; + case SIGNATURE_INVALID: + priv->signature_status = SignatureValidationInfo::SignatureInvalid; + break; + case SIGNATURE_DIGEST_MISMATCH: + priv->signature_status = SignatureValidationInfo::SignatureDigestMismatch; + break; + case SIGNATURE_DECODING_ERROR: + priv->signature_status = SignatureValidationInfo::SignatureDecodingError; + break; + default: + case SIGNATURE_GENERIC_ERROR: + priv->signature_status = SignatureValidationInfo::SignatureGenericError; + break; + case SIGNATURE_NOT_FOUND: + priv->signature_status = SignatureValidationInfo::SignatureNotFound; + break; + case SIGNATURE_NOT_VERIFIED: + priv->signature_status = SignatureValidationInfo::SignatureNotVerified; + break; + } + switch (si->getCertificateValStatus()) { + case CERTIFICATE_TRUSTED: + priv->certificate_status = SignatureValidationInfo::CertificateTrusted; + break; + case CERTIFICATE_UNTRUSTED_ISSUER: + priv->certificate_status = SignatureValidationInfo::CertificateUntrustedIssuer; + break; + case CERTIFICATE_UNKNOWN_ISSUER: + priv->certificate_status = SignatureValidationInfo::CertificateUnknownIssuer; + break; + case CERTIFICATE_REVOKED: + priv->certificate_status = SignatureValidationInfo::CertificateRevoked; + break; + case CERTIFICATE_EXPIRED: + priv->certificate_status = SignatureValidationInfo::CertificateExpired; + break; + default: + case CERTIFICATE_GENERIC_ERROR: + priv->certificate_status = SignatureValidationInfo::CertificateGenericError; + break; + case CERTIFICATE_NOT_VERIFIED: + priv->certificate_status = SignatureValidationInfo::CertificateNotVerified; + break; + } + priv->signer_name = si->getSignerName(); + priv->signing_time = si->getSigningTime(); + + return SignatureValidationInfo(priv); +} + } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/qt5/src/poppler-form.h new/poppler-0.51.0/qt5/src/poppler-form.h --- old/poppler-0.50.0/qt5/src/poppler-form.h 2016-12-07 01:38:42.000000000 +0100 +++ new/poppler-0.51.0/qt5/src/poppler-form.h 2017-01-14 23:42:26.000000000 +0100 @@ -1,7 +1,8 @@ /* poppler-form.h: qt interface to poppler * Copyright (C) 2007-2008, Pino Toscano <[email protected]> - * Copyright (C) 2008, 2011, Albert Astals Cid <[email protected]> + * Copyright (C) 2008, 2011, 2016, 2017, Albert Astals Cid <[email protected]> * Copyright (C) 2012, Adam Reichold <[email protected]> + * Copyright (C) 2016, Hanno Meyer-Thurow <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,6 +24,7 @@ #include <QtCore/QRectF> #include <QtCore/QStringList> +#include <QtCore/QSharedPointer> #include "poppler-export.h" class Page; @@ -30,6 +32,7 @@ class FormWidgetButton; class FormWidgetText; class FormWidgetChoice; +class FormWidgetSignature; namespace Poppler { @@ -74,9 +77,15 @@ int id() const; /** - The internal name of the field. + The internal name (T) of the field. */ QString name() const; + + /** + Sets the internal name (T) of the field. + \since 0.51 + */ + void setName(const QString &name) const; /** The internal fully qualified name of the field. @@ -338,6 +347,109 @@ Q_DISABLE_COPY(FormFieldChoice) }; + /** + A signature validation info helper class. + + \since 0.51 + */ + class SignatureValidationInfoPrivate; + class POPPLER_QT5_EXPORT SignatureValidationInfo { + public: + + /** + The verfication result of the signature. + */ + enum SignatureStatus { + SignatureValid, ///< The signature is cryptographically valid. + SignatureInvalid, ///< The signature is cryptographically invalid. + SignatureDigestMismatch, ///< The document content was changed after the signature was applied. + SignatureDecodingError, ///< The signature CMS/PKCS7 structure is malformed. + SignatureGenericError, ///< The signature could not be verified. + SignatureNotFound, ///< The requested signature is not present in the document. + SignatureNotVerified ///< The signature is not yet verified. + }; + + /** + The verification result of the certificate. + */ + enum CertificateStatus { + CertificateTrusted, ///< The certificate is considered trusted. + CertificateUntrustedIssuer, ///< The issuer of this certificate has been marked as untrusted by the user. + CertificateUnknownIssuer, ///< The certificate trust chain has not finished in a trusted root certificate. + CertificateRevoked, ///< The certificate was revoked by the issuing certificate authority. + CertificateExpired, ///< The signing time is outside the validity bounds of this certificate. + CertificateGenericError, ///< The certificate could not be verified. + CertificateNotVerified ///< The certificate is not yet verified. + }; + + /// \cond PRIVATE + SignatureValidationInfo(SignatureValidationInfoPrivate *priv); + /// \endcond + ~SignatureValidationInfo(); + + /** + The signature status of the signature. + */ + SignatureStatus signatureStatus() const; + + /** + The certificate status of the signature. + */ + CertificateStatus certificateStatus() const; + + /** + The signer name associated with the signature. + */ + QString signerName() const; + + /** + The signing time associated with the signature. + */ + time_t signingTime() const; + + SignatureValidationInfo(const SignatureValidationInfo &other); + SignatureValidationInfo &operator=(const SignatureValidationInfo &other); + + private: + Q_DECLARE_PRIVATE(SignatureValidationInfo) + + QSharedPointer<SignatureValidationInfoPrivate> d_ptr; + }; + + /** + A form field that represents a signature. + + \since 0.51 + */ + class POPPLER_QT5_EXPORT FormFieldSignature : public FormField { + public: + + /** + The validation options of this signature. + */ + enum ValidateOptions { + ValidateVerifyCertificate = 1, ///< Validate the certificate. + ValidateForceRevalidation = 2, ///< Force revalidation of the certificate. + }; + + /// \cond PRIVATE + FormFieldSignature(DocumentData *doc, ::Page *p, ::FormWidgetSignature *w); + /// \endcond + virtual ~FormFieldSignature(); + + virtual FormType type() const; + + /** + Validate the signature. + + Reset signature validatation info of scoped instance. + */ + SignatureValidationInfo validate(ValidateOptions opt) const; + + private: + Q_DISABLE_COPY(FormFieldSignature) + }; + } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/qt5/src/poppler-link.cc new/poppler-0.51.0/qt5/src/poppler-link.cc --- old/poppler-0.50.0/qt5/src/poppler-link.cc 2016-12-15 20:08:06.000000000 +0100 +++ new/poppler-0.51.0/qt5/src/poppler-link.cc 2017-01-13 00:00:34.000000000 +0100 @@ -296,17 +296,19 @@ LinkDestination::LinkDestination(const QString &description) : d( new LinkDestinationPrivate ) { - QStringList tokens = description.split( ';' ); - d->kind = static_cast<Kind>(tokens.at(0).toInt()); - d->pageNum = tokens.at(1).toInt(); - d->left = tokens.at(2).toDouble(); - d->bottom = tokens.at(3).toDouble(); - d->right = tokens.at(4).toDouble(); - d->top = tokens.at(5).toDouble(); - d->zoom = tokens.at(6).toDouble(); - d->changeLeft = static_cast<bool>(tokens.at(7).toInt()); - d->changeTop = static_cast<bool>(tokens.at(8).toInt()); - d->changeZoom = static_cast<bool>(tokens.at(9).toInt()); + const QStringList tokens = description.split( ';' ); + if (tokens.size() >= 10) { + d->kind = static_cast<Kind>(tokens.at(0).toInt()); + d->pageNum = tokens.at(1).toInt(); + d->left = tokens.at(2).toDouble(); + d->bottom = tokens.at(3).toDouble(); + d->right = tokens.at(4).toDouble(); + d->top = tokens.at(5).toDouble(); + d->zoom = tokens.at(6).toDouble(); + d->changeLeft = static_cast<bool>(tokens.at(7).toInt()); + d->changeTop = static_cast<bool>(tokens.at(8).toInt()); + d->changeZoom = static_cast<bool>(tokens.at(9).toInt()); + } } LinkDestination::LinkDestination(const LinkDestination &other) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/qt5/src/poppler-page.cc new/poppler-0.51.0/qt5/src/poppler-page.cc --- old/poppler-0.50.0/qt5/src/poppler-page.cc 2016-12-15 20:08:06.000000000 +0100 +++ new/poppler-0.51.0/qt5/src/poppler-page.cc 2017-01-11 23:42:48.000000000 +0100 @@ -16,6 +16,7 @@ * Copyright (C) 2012, 2013 Thomas Freitag <[email protected]> * Copyright (C) 2015 William Bader <[email protected]> * Copyright (C) 2016 Arseniy Lartsev <[email protected]> + * Copyright (C) 2016, Hanno Meyer-Thurow <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -767,6 +768,12 @@ } break; + case formSignature: + { + ff = new FormFieldSignature(m_page->parentDoc, p, static_cast<FormWidgetSignature*>(fm)); + } + break; + default: ; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/qt5/tests/poppler-forms.cpp new/poppler-0.51.0/qt5/tests/poppler-forms.cpp --- old/poppler-0.50.0/qt5/tests/poppler-forms.cpp 2016-12-07 01:38:42.000000000 +0100 +++ new/poppler-0.51.0/qt5/tests/poppler-forms.cpp 2017-01-11 23:42:48.000000000 +0100 @@ -1,4 +1,5 @@ #include <QtCore/QCoreApplication> +#include <QtCore/QDateTime> #include <QtCore/QDebug> #include <iostream> @@ -46,6 +47,34 @@ return out; } +std::ostream& operator<< (std::ostream &out, Poppler::SignatureValidationInfo::SignatureStatus status) +{ + switch (status) { + case Poppler::SignatureValidationInfo::SignatureValid: out << "Valid"; break; + case Poppler::SignatureValidationInfo::SignatureInvalid: out << "Invalid"; break; + case Poppler::SignatureValidationInfo::SignatureDigestMismatch: out << "DigestMismatch"; break; + case Poppler::SignatureValidationInfo::SignatureDecodingError: out << "DecodingError"; break; + case Poppler::SignatureValidationInfo::SignatureGenericError: out << "GenericError"; break; + case Poppler::SignatureValidationInfo::SignatureNotFound: out << "NotFound"; break; + case Poppler::SignatureValidationInfo::SignatureNotVerified: out << "NotVerifiedYet"; break; + } + return out; +} + +std::ostream& operator<< (std::ostream &out, Poppler::SignatureValidationInfo::CertificateStatus status) +{ + switch (status) { + case Poppler::SignatureValidationInfo::CertificateTrusted: out << "Trusted"; break; + case Poppler::SignatureValidationInfo::CertificateUntrustedIssuer: out << "UntrustedIssuer"; break; + case Poppler::SignatureValidationInfo::CertificateUnknownIssuer: out << "UnknownIssuer"; break; + case Poppler::SignatureValidationInfo::CertificateRevoked: out << "Revoked"; break; + case Poppler::SignatureValidationInfo::CertificateExpired: out << "Expired"; break; + case Poppler::SignatureValidationInfo::CertificateGenericError: out << "GenericError"; break; + case Poppler::SignatureValidationInfo::CertificateNotVerified: out << "NotVerifiedYet"; break; + } + return out; +} + std::ostream& operator<< (std::ostream &out, Qt::Alignment alignment) { switch (alignment) { @@ -155,11 +184,27 @@ } break; - case Poppler::FormField::FormSignature: + case Poppler::FormField::FormSignature: { + const Poppler::FormFieldSignature *signatureForm = static_cast<const Poppler::FormFieldSignature *>(form); + const Poppler::SignatureValidationInfo svi = signatureForm->validate(Poppler::FormFieldSignature::ValidateVerifyCertificate); + std::cout << "\t\t\tSignatureStatus: " << svi.signatureStatus() << std::endl; + std::cout << "\t\t\tCertificateStatus: " << svi.certificateStatus() << std::endl; + if (svi.signerName().isEmpty() == false) + std::cout << "\t\t\tSignerName: " << svi.signerName() << std::endl; + else + std::cout << "\t\t\tSignerName: " << "(null)" << std::endl; + // http://doc.qt.io/qt-5/qdatetime.html#fromTime_t-1 + // Requires Qt 5.2 -> configure.ac update + // QDateTime::fromTime_t(svi->signingTime(), Qt::UTC).toString(); + QDateTime sviTime; + sviTime.setTime_t(svi.signingTime()); + std::cout << "\t\t\tSigningTime: " << sviTime.toString() << std::endl; + } break; } } qDeleteAll(forms); + delete page; } } delete doc; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/poppler-0.50.0/utils/pdfunite.cc new/poppler-0.51.0/utils/pdfunite.cc --- old/poppler-0.50.0/utils/pdfunite.cc 2016-12-06 23:48:28.000000000 +0100 +++ new/poppler-0.51.0/utils/pdfunite.cc 2017-01-09 00:25:41.000000000 +0100 @@ -4,7 +4,7 @@ // // This file is licensed under the GPLv2 or later // -// Copyright (C) 2011-2015 Thomas Freitag <[email protected]> +// Copyright (C) 2011-2015, 2017 Thomas Freitag <[email protected]> // Copyright (C) 2012 Arseny Solokha <[email protected]> // Copyright (C) 2012 Fabio D'Urso <[email protected]> // Copyright (C) 2012, 2014 Albert Astals Cid <[email protected]> @@ -164,6 +164,26 @@ } } +void doMergeFormDict(Dict *srcFormDict, Dict *mergeFormDict, int numOffset) { + Object srcFields, mergeFields; + + srcFormDict->lookup("Fields", &srcFields); + mergeFormDict->lookup("Fields", &mergeFields); + if (srcFields.isArray() && mergeFields.isArray()) { + for (int i = 0; i < mergeFields.arrayGetLength(); i++) { + Object value; + Object *newValue = new Object(); + mergeFields.arrayGetNF(i, &value); + newValue->initRef(value.getRef().num + numOffset, value.getRef().gen); + srcFields.arrayAdd(newValue); + value.free(); + delete newValue; + } + } + srcFields.free(); + mergeFields.free(); +} + /////////////////////////////////////////////////////////////////////////// int main (int argc, char *argv[]) /////////////////////////////////////////////////////////////////////////// @@ -360,7 +380,7 @@ annotsObj.free(); } } - Object pageCatObj, pageNames; + Object pageCatObj, pageNames, pageForm; docs[i]->getXRef()->getCatalog(&pageCatObj); Dict *pageCatDict = pageCatObj.getDict(); pageCatDict->lookup("Names", &pageNames); @@ -371,6 +391,15 @@ } doMergeNameDict(docs[i], yRef, countRef, 0, 0, names.getDict(), pageNames.getDict(), numOffset); } + pageCatDict->lookup("AcroForm", &pageForm); + if (i > 0 && !pageForm.isNull() && pageForm.isDict()) { + if (afObj.isNull()) { + pageCatDict->lookupNF("AcroForm", &afObj); + } else if (afObj.isDict()) { + doMergeFormDict(afObj.getDict(), pageForm.getDict(), numOffset); + } + } + pageForm.free(); pageNames.free(); pageCatObj.free(); objectsCount += docs[i]->writePageObjects(outStr, yRef, numOffset, gTrue);
