Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package pdftk for openSUSE:Factory checked 
in at 2022-09-23 14:15:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pdftk (Old)
 and      /work/SRC/openSUSE:Factory/.pdftk.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pdftk"

Fri Sep 23 14:15:29 2022 rev:8 rq:1005572 version:3.3.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/pdftk/pdftk.changes      2021-12-28 
12:27:08.976508116 +0100
+++ /work/SRC/openSUSE:Factory/.pdftk.new.2275/pdftk.changes    2022-09-23 
14:16:18.634133297 +0200
@@ -1,0 +2,14 @@
+Fri Sep 23 06:23:29 UTC 2022 - Paolo Stivanin <i...@paolostivanin.com>
+
+- update to version 3.3.3:
+  + Added
+    - Support UTF-8 encoded FDF files
+  + Changed
+     - Preserve external links originating from stamps
+  + Fixed
+    - Crash reading invalid bookmarks
+    - Detect invalid parent entries in root form fields
+    - Crash reading invalid XFDF forms
+    - Crashes with non-conforming inputs
+
+-------------------------------------------------------------------

Old:
----
  pdftk-v3.3.2.tar.bz2

New:
----
  pdftk-v3.3.3.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ pdftk.spec ++++++
--- /var/tmp/diff_new_pack.ZZZnRI/_old  2022-09-23 14:16:19.106134397 +0200
+++ /var/tmp/diff_new_pack.ZZZnRI/_new  2022-09-23 14:16:19.110134406 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package pdftk
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 # Copyright (c) 2020 Franz Sirl (fsirl)
 #
 # All modifications and additions to the file contributed by third parties
@@ -18,7 +18,7 @@
 
 
 Name:           pdftk
-Version:        3.3.2
+Version:        3.3.3
 Release:        0
 Summary:        A handy tool for manipulating PDF
 License:        GPL-2.0-or-later

++++++ pdftk-v3.3.2.tar.bz2 -> pdftk-v3.3.3.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/.gitlab-ci.yml 
new/pdftk-v3.3.3/.gitlab-ci.yml
--- old/pdftk-v3.3.2/.gitlab-ci.yml     2021-12-20 18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/.gitlab-ci.yml     2022-09-22 19:23:10.000000000 +0200
@@ -1,6 +1,6 @@
 variables:
   PACKAGE_REGISTRY_URL: 
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/pdftk-java"
-  GRADLE_VERSION: "7.3.2"
+  GRADLE_VERSION: "7.5.1"
 
 .ant-job:
   stage: test
@@ -16,7 +16,7 @@
   extends: .ant-job
   script:
     - ant -lib /usr/share/java
-    - echo -e '#!/bin/bash\njava -cp' 
`pwd`'/build/jar/pdftk.jar:'`pwd`'/lib/bcprov-jdk15on-1.70.jar:'`pwd`'/lib/commons-lang3-3.12.0.jar
 com.gitlab.pdftk_java.pdftk "$@"' > /usr/bin/pdftk
+    - echo -e '#!/bin/bash\njava -cp' 
`pwd`'/build/jar/pdftk.jar:'`pwd`'/lib/bcprov-jdk18on-1.71.jar:'`pwd`'/lib/commons-lang3-3.12.0.jar
 com.gitlab.pdftk_java.pdftk "$@"' > /usr/bin/pdftk
     - chmod +x /usr/bin/pdftk
     - apt-get install php-mbstring php-xml composer -yqq
     - git clone --depth 1 https://github.com/marcvinyals/php-pdftk
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/CHANGELOG.md 
new/pdftk-v3.3.3/CHANGELOG.md
--- old/pdftk-v3.3.2/CHANGELOG.md       2021-12-20 18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/CHANGELOG.md       2022-09-22 19:23:10.000000000 +0200
@@ -1,3 +1,17 @@
+## [3.3.3] - 2022-09-22
+
+### Added
+ - Support UTF-8 encoded FDF files
+
+### Changed
+ - Preserve external links originating from stamps
+
+### Fixed
+ - Crash reading invalid bookmarks
+ - Detect invalid parent entries in root form fields
+ - Crash reading invalid XFDF forms
+ - Crashes with non-conforming inputs 
+
 ## [3.3.2] - 2021-12-20
 
 ### Fixed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/META-INF/native-image/reflect-config.json 
new/pdftk-v3.3.3/META-INF/native-image/reflect-config.json
--- old/pdftk-v3.3.2/META-INF/native-image/reflect-config.json  1970-01-01 
01:00:00.000000000 +0100
+++ new/pdftk-v3.3.3/META-INF/native-image/reflect-config.json  2022-09-22 
19:23:10.000000000 +0200
@@ -0,0 +1,6 @@
+[
+    {
+        "name": "com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfName",
+        "allDeclaredFields": true
+    }
+]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/README.md new/pdftk-v3.3.3/README.md
--- old/pdftk-v3.3.2/README.md  2021-12-20 18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/README.md  2022-09-22 19:23:10.000000000 +0200
@@ -29,13 +29,12 @@
 are older than 3.0.4, which fixed many crashes. Consider
 updating to an unstable package with a more recent version.
 
-:warning: As of May 2021 homebrew packages do not yet support M1
-chips; a temporary alternative is to [install an Intel version of
 homebrew](https://gitlab.com/pdftk-java/pdftk/-/issues/89#note_576347882)
 alongside the M1 version.
 
-A third-party [docker image](https://hub.docker.com/r/minidocks/pdftk)
-based on a native image is also available.
+Third party Docker images are available from
+https://hub.docker.com/r/pdftk/pdftk and
+https://hub.docker.com/r/minidocks/pdftk.
 
 ### Pre-built binaries
 
@@ -43,14 +42,15 @@
 manager, but if that is not an option there are pre-built binaries
 available:
 
- - [Standalone 
jar](https://gitlab.com/pdftk-java/pdftk/-/jobs/1527259628/artifacts/raw/build/libs/pdftk-all.jar),
 including dependencies. Requires a JRE at runtime.
- - :warning: **Experimental** [Native 
Image](https://gitlab.com/pdftk-java/pdftk/-/jobs/1527259632/artifacts/raw/build/native-image/pdftk)
 for x86_64 GNU/Linux systems. Does not require any runtime dependencies.
+ - [Standalone 
jar](https://gitlab.com/api/v4/projects/5024297/packages/generic/pdftk-java/v3.3.3/pdftk-all.jar),
 including dependencies. Requires a JRE at runtime.
+ - :warning: **Experimental** [Native 
Image](https://gitlab.com/api/v4/projects/5024297/packages/generic/pdftk-java/v3.3.3/pdftk)
 for x86_64 GNU/Linux systems. Does not require any runtime dependencies.
+ - :warning: **Experimental, third party** [Native 
Image](https://gitlab.com/pdftk-java/pdftk/uploads/2b32d1c2f855f92cea379f566a882ac3/native-image.zip)
 for aarch64/M1 macOS systems. Does not require any runtime dependencies. Note 
this image was built by a third party and is not verified (see #129).
 
 ## Dependencies
 
  - jdk >= 1.8
- - commons-lang3
- - bcprov
+ - commons-lang3 (or apply a [patch for compatibility with 
commons-text](patches/commons-lang3-to-text.patch))
+ - bcprov >= 1.63 (or apply a [patch for compatibility with bcprov < 
1.63](patches/bcprov-lt-163.patch) (discouraged, see #122))
  - gradle >= 7.3 or ant (build time)
  - ivy (optionally for ant, for resolving dependencies at build time)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/build.gradle 
new/pdftk-v3.3.3/build.gradle
--- old/pdftk-v3.3.2/build.gradle       2021-12-20 18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/build.gradle       2022-09-22 19:23:10.000000000 +0200
@@ -1,8 +1,8 @@
 plugins {
     id 'java'
     id 'application'
-    id 'com.diffplug.spotless' version '6.0.5'
-    id 'com.github.johnrengelman.shadow' version '7.1.1'
+    id 'com.diffplug.spotless' version '6.10.0'
+    id 'com.github.johnrengelman.shadow' version '7.1.2'
     id 'org.mikeneck.graalvm-native-image' version '1.4.1'
 }
 
@@ -32,7 +32,7 @@
 
 dependencies {
     implementation 'org.apache.commons:commons-lang3:3.12.0'
-    implementation 'org.bouncycastle:bcprov-jdk15on:1.70'
+    implementation 'org.bouncycastle:bcprov-jdk18on:1.71'
 }
 
 nativeImage {
@@ -40,6 +40,7 @@
   executableName = 'pdftk'
   arguments(
       
'-H:ResourceConfigurationFiles=META-INF/native-image/resource-config.json',
+      
'-H:ReflectionConfigurationFiles=META-INF/native-image/reflect-config.json',
       '--no-fallback',
       '-H:+AddAllCharsets',
       '-H:Log=registerResource:',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/ivy.xml new/pdftk-v3.3.3/ivy.xml
--- old/pdftk-v3.3.2/ivy.xml    2021-12-20 18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/ivy.xml    2022-09-22 19:23:10.000000000 +0200
@@ -6,7 +6,7 @@
     <conf name="test" extends="build"/>
   </configurations>
   <dependencies>
-    <dependency org="org.bouncycastle" name="bcprov-jdk15on" rev="1.70"/>
+    <dependency org="org.bouncycastle" name="bcprov-jdk18on" rev="1.71"/>
     <dependency org="org.apache.commons" name="commons-lang3" rev="3.12.0"/>
     <dependency org="junit" name="junit" rev="4.12" conf="test"/>
     <dependency org="com.github.stefanbirkner" name="system-rules" 
rev="1.19.0" conf="test"/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/bookmarks.java 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/bookmarks.java
--- old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/bookmarks.java  2021-12-20 
18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/bookmarks.java  2022-09-22 
19:23:10.000000000 +0200
@@ -200,6 +200,7 @@
         }
 
         // destination is an array
+        // Named destinations handled by 
PdfReader::consolidateNamedDestinations
         if (destination_p != null && destination_p.isArray()) {
 
           ArrayList<PdfObject> array_list_p = ((PdfArray) 
destination_p).getArrayList();
@@ -208,14 +209,17 @@
             PdfObject page_p = reader_p.getPdfObject(array_list_p.get(0));
             if (page_p != null && page_p.isDictionary()) {
               bookmark.m_page_num = GetPageNumber((PdfDictionary) page_p, 
reader_p, cache) + 1;
+            } else if (page_p != null && page_p.isNumber()) {
+              // page_p should always be a PdfDictionary (cf PDF Reference 1.7 
Section 12.3.2.2)
+              // but seen PdfNumber in the wild (cf pdftk-java issue 123)
+              bookmark.m_page_num = ((PdfNumber) page_p).intValue() + 1;
             } else { // error
               fail_b = true;
             }
           } else { // error
             fail_b = true;
           }
-        } // TODO: named destinations handling
-        else { // error
+        } else { // error
           fail_b = true;
         }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/cat.java 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/cat.java
--- old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/cat.java        2021-12-20 
18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/cat.java        2022-09-22 
19:23:10.000000000 +0200
@@ -58,18 +58,27 @@
     m_output_keep_final_id_b = session.m_output_keep_final_id_b;
   }
 
-  static char GetPdfVersionChar(PdfName version_p) {
+  static char GetPdfVersionChar(PdfObject version_p) {
     char version_cc = PdfWriter.VERSION_1_4; // default
 
-    if (version_p != null)
-      if (version_p.equals(PdfName.VERSION_1_4)) version_cc = 
PdfWriter.VERSION_1_4;
-      else if (version_p.equals(PdfName.VERSION_1_5)) version_cc = 
PdfWriter.VERSION_1_5;
-      else if (version_p.equals(PdfName.VERSION_1_6)) version_cc = 
PdfWriter.VERSION_1_6;
-      else if (version_p.equals(PdfName.VERSION_1_7)) version_cc = 
PdfWriter.VERSION_1_7;
-      else if (version_p.equals(PdfName.VERSION_1_3)) version_cc = 
PdfWriter.VERSION_1_3;
-      else if (version_p.equals(PdfName.VERSION_1_2)) version_cc = 
PdfWriter.VERSION_1_2;
-      else if (version_p.equals(PdfName.VERSION_1_1)) version_cc = 
PdfWriter.VERSION_1_1;
-      else if (version_p.equals(PdfName.VERSION_1_0)) version_cc = 
PdfWriter.VERSION_1_0;
+    if (version_p == null) return version_cc;
+
+    if (!version_p.isName()) {
+      try {
+        version_p = new PdfName(version_p.toString());
+      } catch (Exception e) {
+        return version_cc;
+      }
+    }
+
+    if (version_p.equals(PdfName.VERSION_1_4)) version_cc = 
PdfWriter.VERSION_1_4;
+    else if (version_p.equals(PdfName.VERSION_1_5)) version_cc = 
PdfWriter.VERSION_1_5;
+    else if (version_p.equals(PdfName.VERSION_1_6)) version_cc = 
PdfWriter.VERSION_1_6;
+    else if (version_p.equals(PdfName.VERSION_1_7)) version_cc = 
PdfWriter.VERSION_1_7;
+    else if (version_p.equals(PdfName.VERSION_1_3)) version_cc = 
PdfWriter.VERSION_1_3;
+    else if (version_p.equals(PdfName.VERSION_1_2)) version_cc = 
PdfWriter.VERSION_1_2;
+    else if (version_p.equals(PdfName.VERSION_1_1)) version_cc = 
PdfWriter.VERSION_1_1;
+    else if (version_p.equals(PdfName.VERSION_1_0)) version_cc = 
PdfWriter.VERSION_1_0;
 
     return version_cc;
   }
@@ -194,7 +203,7 @@
       PdfDictionary catalog_p = reader_p.getCatalog();
       if (catalog_p.contains(PdfName.VERSION)) {
 
-        PdfName version_p = (PdfName) 
reader_p.getPdfObject(catalog_p.get(PdfName.VERSION));
+        PdfObject version_p = 
reader_p.getPdfObject(catalog_p.get(PdfName.VERSION));
         char version_cc = GetPdfVersionChar(version_p);
 
         if (max_version_cc < version_cc) max_version_cc = version_cc;
@@ -211,7 +220,19 @@
           // iterate over developers
           Set<PdfObject> keys_p = extensions_p.getKeys();
           for (PdfObject kit : keys_p) {
-            PdfName developer_p = (PdfName) reader_p.getPdfObject(kit);
+            // We need to be defensive about object types
+            // cf https://gitlab.com/pdftk-java/pdftk/-/issues/127
+            PdfObject developer_po = reader_p.getPdfObject(kit);
+            PdfName developer_p = null;
+            if (developer_po.isName()) {
+              developer_p = (PdfName) developer_po;
+            } else {
+              try {
+                developer_p = new PdfName(developer_po.toString());
+              } catch (Exception e) {
+                continue;
+              }
+            }
 
             PdfObject dev_exts_po = 
reader_p.getPdfObject(extensions_p.get(developer_p));
             if (dev_exts_po != null && dev_exts_po.isDictionary()) {
@@ -221,22 +242,43 @@
                   && dev_exts_p.contains(PdfName.EXTENSIONLEVEL)) {
                 // use the greater base version or the greater extension level
 
-                PdfName base_version_p =
-                    (PdfName) 
reader_p.getPdfObject(dev_exts_p.get(PdfName.BASEVERSION));
-                PdfNumber ext_level_p =
-                    (PdfNumber) 
reader_p.getPdfObject(dev_exts_p.get(PdfName.EXTENSIONLEVEL));
+                PdfObject base_version_po =
+                    reader_p.getPdfObject(dev_exts_p.get(PdfName.BASEVERSION));
+                PdfName base_version_p = null;
+                if (base_version_po.isName()) {
+                  base_version_p = (PdfName) base_version_p;
+                } else {
+                  try {
+                    base_version_p = new PdfName(base_version_po.toString());
+                  } catch (Exception e) {
+                    continue;
+                  }
+                }
+
+                PdfObject ext_level_po =
+                    
reader_p.getPdfObject(dev_exts_p.get(PdfName.EXTENSIONLEVEL));
+                Integer ext_level_i = null;
+                if (ext_level_po.isNumber()) {
+                  ext_level_i = ((PdfNumber) ext_level_po).intValue();
+                } else {
+                  try {
+                    ext_level_i = Integer.valueOf(ext_level_i.toString());
+                  } catch (Exception e) {
+                    continue;
+                  }
+                }
 
                 if (!ext_base_versions.containsKey(developer_p)
                     || GetPdfVersionChar(ext_base_versions.get(developer_p))
-                        < GetPdfVersionChar(base_version_p)) {
+                        < GetPdfVersionChar(base_version_po)) {
                   // new developer or greater base version
                   ext_base_versions.put(developer_p, base_version_p);
-                  ext_levels.put(developer_p, ext_level_p.intValue());
+                  ext_levels.put(developer_p, ext_level_i);
                 } else if 
(GetPdfVersionChar(ext_base_versions.get(developer_p))
-                        == GetPdfVersionChar(base_version_p)
-                    && ext_levels.get(developer_p) < ext_level_p.intValue()) {
+                        == GetPdfVersionChar(base_version_po)
+                    && ext_levels.get(developer_p) < ext_level_i) {
                   // greater extension level for current base version
-                  ext_levels.put(developer_p, ext_level_p.intValue());
+                  ext_levels.put(developer_p, ext_level_i);
                 }
               }
             }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/DocWriter.java 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/DocWriter.java
--- old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/DocWriter.java 
2021-12-20 18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/DocWriter.java 
2022-09-22 19:23:10.000000000 +0200
@@ -113,10 +113,10 @@
     // ssteward omit: protected Document document;
 
 /** The outputstream of this writer. */
-    protected OutputStreamCounter os;
+    public OutputStreamCounter os;
 
 /** Is the writer open for writing? */
-    protected boolean open = false;
+    public boolean open = false;
 
 /** Do we have to pause all writing actions? */
     // ssteward: changed from "pause" to "m_pause" to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/FdfReader.java 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/FdfReader.java
--- 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/FdfReader.java 
    2021-12-20 18:20:25.000000000 +0100
+++ 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/FdfReader.java 
    2022-09-22 19:23:10.000000000 +0200
@@ -204,6 +204,10 @@
                     return new String(b, "GBK");
                 else if (encoding.equals(PdfName.BIGFIVE))
                     return new String(b, "Big5");
+                else if (encoding.equals(PdfName.UTF_8))
+                    return new String(b, "UTF-8");
+                else if (encoding.equals(PdfName.UTF_16))
+                    return new String(b, "UTF-16");
             }
             catch (Exception e) {
             }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfCopy.java 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfCopy.java
--- 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfCopy.java   
    2021-12-20 18:20:25.000000000 +0100
+++ 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfCopy.java   
    2022-09-22 19:23:10.000000000 +0200
@@ -171,6 +171,13 @@
         topPageParent = getPdfIndirectReference();
         getRoot().setLinearMode(topPageParent);
     }
+    // Overlay on top of another writer
+    public PdfCopy(PdfWriter master) {
+        os=master.os;
+        body=master.body;
+        open=true;
+        indirectMap = new HashMap();
+    }
 
     /**
      * Grabs a page from the input document
@@ -207,7 +214,7 @@
      * we do from their namespace to ours is *at best* heuristic, and 
guaranteed to
      * fail under some circumstances.
      */
-    protected PdfIndirectReference copyIndirect(PRIndirectReference in) throws 
IOException, BadPdfFormatException {
+    public PdfIndirectReference copyIndirect(PRIndirectReference in) throws 
IOException, BadPdfFormatException {
         RefKey key = new RefKey(in);
         IndirectReferences iRef = (IndirectReferences)indirects.get(key);
                boolean recurse_b= true; // ssteward
@@ -397,6 +404,18 @@
                        */
         }
     }
+    // Get a form field parent. There is an additional check to make
+    // sure the parent is really another form field, since some inputs
+    // in the wild have pointers to wrong parents.
+    // See https://gitlab.com/pdftk-java/pdftk/-/issues/124
+    public PdfIndirectReference getParent(PdfDictionary annot) {
+        PdfIndirectReference parent_ref= 
annot.getAsIndirectObject(PdfName.PARENT);
+        if (parent_ref == null) return null;
+        PdfDictionary parent = annot.getAsDict(PdfName.PARENT);
+        if (parent == null) return null;
+        if (!parent.contains(PdfName.KIDS)) return null;
+        return parent_ref;
+    }
     /**
      * Add an imported page to our output
      * @param iPage an imported page
@@ -467,12 +486,11 @@
                                                                        //
                                                                        // dig 
upwards, parent-wise; replace annot as we go with the
                                                                        // 
top-most form field dictionary
-                                                                       
PdfIndirectReference parent_ref=
-                                                                               
(PdfIndirectReference)annot.get(PdfName.PARENT);
-                                                                       while( 
parent_ref!= null && parent_ref.isIndirect() ) {
+                                                                       while( 
true ) {
+                                                                               
PdfIndirectReference parent_ref= getParent(annot);
+                                                                               
if (parent_ref == null) break;
                                                                                
annot_ref= parent_ref;
                                                                                
annot= (PdfDictionary)PdfReader.getPdfObject(annot_ref);
-                                                                               
parent_ref= (PdfIndirectReference)annot.get(PdfName.PARENT);
 
                                                                                
tt_obj= PdfReader.getPdfObject(annot.get(PdfName.T));
                                                                                
if( tt_obj!= null && tt_obj.isString() ) {
@@ -590,12 +608,11 @@
                                                                        // we 
have a form field
 
                                                                        // dig 
upwards, parent-wise
-                                                                       
PdfIndirectReference parent_ref=
-                                                                               
(PdfIndirectReference)annot.get(PdfName.PARENT);
-                                                                       while( 
parent_ref!= null && parent_ref.isIndirect() ) {
+                                                                       while( 
true ) {
+                                                                               
PdfIndirectReference parent_ref= getParent(annot);
+                                                                               
if (parent_ref == null) break;
                                                                                
annot_ref= parent_ref;
                                                                                
annot= (PdfDictionary)PdfReader.getPdfObject(annot_ref);
-                                                                               
parent_ref= (PdfIndirectReference)annot.get(PdfName.PARENT);
                                                                        }
                                                                
                                                                        RefKey 
annot_key= new RefKey(annot_ref);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfName.java 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfName.java
--- 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfName.java   
    2021-12-20 18:20:25.000000000 +0100
+++ 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfName.java   
    2022-09-22 19:23:10.000000000 +0200
@@ -1622,6 +1622,10 @@
     /** A name */
     public static final PdfName USETHUMBS = new PdfName("UseThumbs");
     /** A name */
+    public static final PdfName UTF_8 = new PdfName("utf_8");
+    /** A name */
+    public static final PdfName UTF_16 = new PdfName("utf_16");
+    /** A name */
     public static final PdfName V = new PdfName("V");
     /** A name */
     public static final PdfName V2 = new PdfName("V2");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
--- 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java 
    2021-12-20 18:20:25.000000000 +0100
+++ 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java 
    2022-09-22 19:23:10.000000000 +0200
@@ -3013,7 +3013,7 @@
                     PdfObject v = (PdfObject)ar.get(k);
                     if (v.isIndirect()) {
                         int num = ((PRIndirectReference)v).getNumber();
-                        if (num >= xrefObj.size() || (!partial && 
xrefObj.get(num) == null)) {
+                        if (num < 0 || num >= xrefObj.size() || (!partial && 
xrefObj.get(num) == null)) {
                             ar.set(k, PdfNull.PDFNULL);
                             continue;
                         }
@@ -3034,7 +3034,7 @@
                     PdfObject v = dic.get(key);
                     if (v.isIndirect()) {
                         int num = ((PRIndirectReference)v).getNumber();
-                        if (num >= xrefObj.size() || (!partial && 
xrefObj.get(num) == null)) {
+                        if (num < 0 || num >= xrefObj.size() || (!partial && 
xrefObj.get(num) == null)) {
                             dic.put(key, PdfNull.PDFNULL);
                             continue;
                         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfStamperImp.java
 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfStamperImp.java
--- 
old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfStamperImp.java
 2021-12-20 18:20:25.000000000 +0100
+++ 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfStamperImp.java
 2022-09-22 19:23:10.000000000 +0200
@@ -735,6 +735,10 @@
                 if (ff != null)
                     flags = ff.intValue();
                 int page = ((Integer)item.page.get(k)).intValue();
+                // Page might be out of bounds
+                // See https://gitlab.com/pdftk-java/pdftk/-/issues/134
+                if (page < 1 || page > reader.getNumberOfPages())
+                    continue;
                 PdfDictionary appDic = 
(PdfDictionary)PdfReader.getPdfObject(merged.get(PdfName.AP));
                 if (appDic != null && (flags & PdfFormField.FLAGS_PRINT) != 0 
&& (flags & PdfFormField.FLAGS_HIDDEN) == 0) {
                     PdfObject obj = appDic.get(PdfName.N);
@@ -1120,7 +1124,7 @@
         }
     }
     
-    void addAnnotation(PdfAnnotation annot, int page) {
+    public void addAnnotation(PdfAnnotation annot, int page) {
         addAnnotation(annot, reader.getPageN(page));
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/filter.java 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/filter.java
--- old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/filter.java     2021-12-20 
18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/filter.java     2022-09-22 
19:23:10.000000000 +0200
@@ -27,16 +27,23 @@
 import com.gitlab.pdftk_java.com.lowagie.text.Rectangle;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.AcroFields;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.FdfReader;
+import com.gitlab.pdftk_java.com.lowagie.text.pdf.PRIndirectReference;
+import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfAnnotation;
+import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfArray;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfBoolean;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfContentByte;
+import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfCopy;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfDictionary;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfImportedPage;
+import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfIndirectReference;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfName;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfNumber;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfObject;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfReader;
+import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfRectangle;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.PdfStamperImp;
 import com.gitlab.pdftk_java.com.lowagie.text.pdf.XfdfReader;
+import java.awt.geom.AffineTransform;
 import java.io.ByteArrayInputStream;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -138,7 +145,13 @@
           // maybe it's xfdf?
           try {
             xfdf_reader_p = new XfdfReader(new ByteArrayInputStream(buffer));
-          } catch (IOException ioe2_p) { // file open error
+          } catch (IOException | RuntimeException ioe2_p) { // file open error
+            // A RuntimeException may occur if the input looks like an
+            // XML file but does not contain an XFDF tag. Probably it
+            // should be an IOException for consistency for
+            // SimpleXMLDocHandler, and certainly not an unchecked
+            // exception. See
+            // https://gitlab.com/pdftk-java/pdftk/-/issues/125
             System.err.println("Error: Failed read form data on stdin.");
             return ErrorCode.ERROR;
           }
@@ -347,6 +360,9 @@
       PdfImportedPage mark_page_p = null;
       Rectangle mark_page_size_p = null;
       int mark_page_rotation = 0;
+      ArrayList<PdfDictionary> mark_annots = new ArrayList();
+      PdfCopy copy = new PdfCopy(writer_p);
+      copy.setFromReader(mark_p);
 
       // iterate over document's pages, adding mark_page as
       // a layer above (stamp) or below (watermark) the page content;
@@ -367,6 +383,9 @@
           // create a PdfTemplate from the first page of mark
           // (PdfImportedPage is derived from PdfTemplate)
           mark_page_p = writer_p.getImportedPage(mark_p, ii);
+
+          PdfDictionary mark_full_page_p = mark_p.getPageN(ii);
+          mark_annots = report.getAnnots(mark_p, mark_full_page_p);
         }
 
         // the target page geometry
@@ -394,35 +413,65 @@
         PdfContentByte content_byte_p =
             (background_b) ? writer_p.getUnderContent(ii) : 
writer_p.getOverContent(ii);
 
+        float[] trans = null;
         if (mark_page_rotation == 0) {
-          content_byte_p.addTemplate(mark_page_p, mark_scale, 0, 0, 
mark_scale, h_trans, v_trans);
+          trans = new float[] {mark_scale, 0, 0, mark_scale, h_trans, v_trans};
         } else if (mark_page_rotation == 90) {
-          content_byte_p.addTemplate(
-              mark_page_p,
-              0,
-              -1 * mark_scale,
-              mark_scale,
-              0,
-              h_trans,
-              v_trans + mark_page_size_p.height() * mark_scale);
+          trans =
+              new float[] {
+                0,
+                -1 * mark_scale,
+                mark_scale,
+                0,
+                h_trans,
+                v_trans + mark_page_size_p.height() * mark_scale
+              };
         } else if (mark_page_rotation == 180) {
-          content_byte_p.addTemplate(
-              mark_page_p,
-              -1 * mark_scale,
-              0,
-              0,
-              -1 * mark_scale,
-              h_trans + mark_page_size_p.width() * mark_scale,
-              v_trans + mark_page_size_p.height() * mark_scale);
+          trans =
+              new float[] {
+                -1 * mark_scale,
+                0,
+                0,
+                -1 * mark_scale,
+                h_trans + mark_page_size_p.width() * mark_scale,
+                v_trans + mark_page_size_p.height() * mark_scale
+              };
         } else if (mark_page_rotation == 270) {
+          trans =
+              new float[] {
+                0,
+                mark_scale,
+                -1 * mark_scale,
+                0,
+                h_trans + mark_page_size_p.width() * mark_scale,
+                v_trans
+              };
+        }
+        if (trans != null) {
           content_byte_p.addTemplate(
-              mark_page_p,
-              0,
-              mark_scale,
-              -1 * mark_scale,
-              0,
-              h_trans + mark_page_size_p.width() * mark_scale,
-              v_trans);
+              mark_page_p, trans[0], trans[1], trans[2], trans[3], trans[4], 
trans[5]);
+        }
+
+        for (PdfDictionary annot : mark_annots) {
+          PdfAnnotation new_annot = new PdfAnnotation(writer_p, null);
+          new_annot.putAll(annot);
+          for (Object key : new_annot.getKeys()) {
+            Object value = new_annot.get((PdfName) key);
+            if (value instanceof PRIndirectReference) {
+              PdfIndirectReference ind = 
copy.copyIndirect((PRIndirectReference) value);
+              new_annot.put((PdfName) key, ind);
+            }
+          }
+          PdfArray rect = (PdfArray) annot.get(PdfName.RECT);
+          float[] rect_f = new float[4];
+          for (int i = 0; i < 4; ++i) rect_f[i] = 
rect.getAsNumber(i).floatValue();
+          AffineTransform M = new AffineTransform(trans);
+          float[] new_rect_f = new float[4];
+          M.transform(rect_f, 0, new_rect_f, 0, 2);
+          PdfRectangle new_rect =
+              new PdfRectangle(new_rect_f[0], new_rect_f[1], new_rect_f[2], 
new_rect_f[3], 0);
+          new_annot.put(PdfName.RECT, new_rect);
+          writer_p.addAnnotation(new_annot, ii);
         }
       }
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/pdftk.java 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/pdftk.java
--- old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/pdftk.java      2021-12-20 
18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/pdftk.java      2022-09-22 
19:23:10.000000000 +0200
@@ -40,7 +40,7 @@
 public class pdftk {
 
   /* TODO: should read from compiler */
-  static final String PDFTK_VER = "3.3.2";
+  static final String PDFTK_VER = "3.3.3";
   static final boolean ASK_ABOUT_WARNINGS = false;
 
   static {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/report.java 
new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/report.java
--- old/pdftk-v3.3.2/java/com/gitlab/pdftk_java/report.java     2021-12-20 
18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/java/com/gitlab/pdftk_java/report.java     2022-09-22 
19:23:10.000000000 +0200
@@ -607,6 +607,28 @@
         "AnnotRect: " + rot_rect[0] + " " + rot_rect[1] + " " + rot_rect[2] + 
" " + rot_rect[3]);
   }
 
+  static ArrayList<PdfDictionary> getAnnots(PdfReader reader_p, PdfDictionary 
page_p) {
+    ArrayList<PdfDictionary> ret = new ArrayList<PdfDictionary>();
+    PdfObject annots_p = reader_p.getPdfObject(page_p.get(PdfName.ANNOTS));
+    if (annots_p == null || !annots_p.isArray()) return ret;
+
+    ArrayList<PdfObject> annots_al_p = ((PdfArray) annots_p).getArrayList();
+
+    for (PdfObject jj : annots_al_p) {
+
+      PdfObject annot_po = reader_p.getPdfObject(jj);
+      if (annot_po == null || !annot_po.isDictionary()) continue;
+
+      PdfDictionary annot_p = (PdfDictionary) annot_po;
+      PdfObject type_p = reader_p.getPdfObject(annot_p.get(PdfName.TYPE));
+      if (!PdfName.ANNOT.equals(type_p)) continue;
+
+      ret.add(annot_p);
+    }
+
+    return ret;
+  }
+
   static void ReportAnnots(PrintStream ofs, PdfReader reader_p, boolean 
utf8_b) {
     reader_p.resetReleasePage();
 
@@ -631,39 +653,24 @@
 
     for (int ii = 1; ii <= reader_p.getNumberOfPages(); ++ii) {
       PdfDictionary page_p = reader_p.getPageN(ii);
+      List<PdfDictionary> annots = getAnnots(reader_p, page_p);
 
-      PdfObject annots_p = reader_p.getPdfObject(page_p.get(PdfName.ANNOTS));
-      if (annots_p != null && annots_p.isArray()) {
-
-        ArrayList<PdfObject> annots_al_p = ((PdfArray) 
annots_p).getArrayList();
-
-        // iterate over annotations
-        for (PdfObject jj : annots_al_p) {
+      // iterate over annotations
+      for (PdfDictionary annot_p : annots) {
+        PdfObject subtype_p = 
reader_p.getPdfObject(annot_p.get(PdfName.SUBTYPE));
+
+        ofs.println("---"); // delim
+        ReportAnnot(ofs, reader_p, ii, page_p, annot_p, utf8_b); // base annot 
items
+        ofs.println("AnnotPageNumber: " + ii);
+
+        // link annotation
+        if (subtype_p.equals(PdfName.LINK)) {
+          // link-specific items
+          if (annot_p.contains(PdfName.A)) { // action
+            PdfObject action_p = reader_p.getPdfObject(annot_p.get(PdfName.A));
+            if (action_p != null && action_p.isDictionary()) {
 
-          PdfObject annot_po = reader_p.getPdfObject(jj);
-          if (annot_po != null && annot_po.isDictionary()) {
-            PdfDictionary annot_p = (PdfDictionary) annot_po;
-
-            PdfObject type_p = 
reader_p.getPdfObject(annot_p.get(PdfName.TYPE));
-            if (type_p != null && type_p.equals(PdfName.ANNOT)) {
-
-              PdfObject subtype_p = 
reader_p.getPdfObject(annot_p.get(PdfName.SUBTYPE));
-
-              ofs.println("---"); // delim
-              ReportAnnot(ofs, reader_p, ii, page_p, annot_p, utf8_b); // base 
annot items
-              ofs.println("AnnotPageNumber: " + ii);
-
-              // link annotation
-              if (subtype_p.equals(PdfName.LINK)) {
-                // link-specific items
-                if (annot_p.contains(PdfName.A)) { // action
-                  PdfObject action_p = 
reader_p.getPdfObject(annot_p.get(PdfName.A));
-                  if (action_p != null && action_p.isDictionary()) {
-
-                    ReportAction(ofs, reader_p, (PdfDictionary) action_p, 
utf8_b, "Annot");
-                  }
-                }
-              }
+              ReportAction(ofs, reader_p, (PdfDictionary) action_p, utf8_b, 
"Annot");
             }
           }
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/patches/bcprov-lt-163.patch 
new/pdftk-v3.3.3/patches/bcprov-lt-163.patch
--- old/pdftk-v3.3.2/patches/bcprov-lt-163.patch        1970-01-01 
01:00:00.000000000 +0100
+++ new/pdftk-v3.3.3/patches/bcprov-lt-163.patch        2022-09-22 
19:23:10.000000000 +0200
@@ -0,0 +1,40 @@
+diff --git a/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfPKCS7.java 
b/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfPKCS7.java
+index 990d492..4ba7fa0 100644
+--- a/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfPKCS7.java
++++ b/java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfPKCS7.java
+@@ -296,7 +296,7 @@ public class PdfPKCS7 {
+             ASN1TaggedObject tagsig = 
(ASN1TaggedObject)signerInfo.getObjectAt(next);
+             ASN1Sequence sseq = (ASN1Sequence)tagsig.getObject();
+             ByteArrayOutputStream bOut = new ByteArrayOutputStream();         
   
+-            ASN1OutputStream dout = ASN1OutputStream.create(bOut);
++            ASN1OutputStream dout = new ASN1OutputStream(bOut);
+             try {
+                 ASN1EncodableVector attribute = new ASN1EncodableVector();
+                 for (int k = 0; k < sseq.size(); ++k) {
+@@ -735,7 +735,7 @@ public class PdfPKCS7 {
+                 digest = sig.sign();
+             ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
+             
+-            ASN1OutputStream dout = ASN1OutputStream.create(bOut);
++            ASN1OutputStream dout = new ASN1OutputStream(bOut);
+             dout.writeObject(new DEROctetString(digest));
+             dout.close();
+             
+@@ -906,7 +906,7 @@ public class PdfPKCS7 {
+             
+             ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
+             
+-            ASN1OutputStream dout = ASN1OutputStream.create(bOut);
++            ASN1OutputStream dout = new ASN1OutputStream(bOut);
+             dout.writeObject(new DERSequence(whole));
+             dout.close();
+             
+@@ -962,7 +962,7 @@ public class PdfPKCS7 {
+             attribute.add(new DERSequence(v));
+             ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
+             
+-            ASN1OutputStream dout = ASN1OutputStream.create(bOut);
++            ASN1OutputStream dout = new ASN1OutputStream(bOut);
+             dout.writeObject(new DERSet(attribute));
+             dout.close();
+             
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/patches/commons-lang3-to-text.patch 
new/pdftk-v3.3.3/patches/commons-lang3-to-text.patch
--- old/pdftk-v3.3.2/patches/commons-lang3-to-text.patch        2021-12-20 
18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/patches/commons-lang3-to-text.patch        2022-09-22 
19:23:10.000000000 +0200
@@ -8,7 +8,7 @@
  dependencies {
 -    implementation 'org.apache.commons:commons-lang3:3.12.0'
 +    implementation 'org.apache.commons:commons-text:1.9'
-     implementation 'org.bouncycastle:bcprov-jdk15on:1.70'
+     implementation 'org.bouncycastle:bcprov-jdk18on:1.71'
  }
  
 diff --git a/ivy.xml b/ivy.xml
@@ -18,7 +18,7 @@
 @@ -7,7 +7,7 @@
    </configurations>
    <dependencies>
-     <dependency org="org.bouncycastle" name="bcprov-jdk15on" rev="1.70"/>
+     <dependency org="org.bouncycastle" name="bcprov-jdk18on" rev="1.71"/>
 -    <dependency org="org.apache.commons" name="commons-lang3" rev="3.12.0"/>
 +    <dependency org="org.apache.commons" name="commons-text" rev="1.9"/>
      <dependency org="junit" name="junit" rev="4.12" conf="test"/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/pom.xml new/pdftk-v3.3.3/pom.xml
--- old/pdftk-v3.3.2/pom.xml    2021-12-20 18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/pom.xml    2022-09-22 19:23:10.000000000 +0200
@@ -9,7 +9,7 @@
   <dependencies>
     <dependency>
       <groupId>org.bouncycastle</groupId>
-      <artifactId>bcprov-jdk15on</artifactId>
+      <artifactId>bcprov-jdk18on</artifactId>
       <version>1.70</version>
     </dependency>
     <dependency>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/test/com/gitlab/pdftk_java/DataFieldsTest.java 
new/pdftk-v3.3.3/test/com/gitlab/pdftk_java/DataFieldsTest.java
--- old/pdftk-v3.3.2/test/com/gitlab/pdftk_java/DataFieldsTest.java     
2021-12-20 18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/test/com/gitlab/pdftk_java/DataFieldsTest.java     
2022-09-22 19:23:10.000000000 +0200
@@ -21,8 +21,8 @@
 
   @Test
   public void dump_data_fields_utf8_options() throws IOException {
-    pdftk("test/files/form-utf8.pdf", "dump_data_fields_utf8");
-    String expectedData = slurp("test/files/form-utf8.data");
+    pdftk("test/files/form-pdfdocencoding.pdf", "dump_data_fields_utf8");
+    String expectedData = slurp("test/files/form-pdfdocencoding.data");
     assertEquals(expectedData, systemOut.getLog());
   }
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/test/com/gitlab/pdftk_java/DataTest.java 
new/pdftk-v3.3.3/test/com/gitlab/pdftk_java/DataTest.java
--- old/pdftk-v3.3.2/test/com/gitlab/pdftk_java/DataTest.java   2021-12-20 
18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/test/com/gitlab/pdftk_java/DataTest.java   2022-09-22 
19:23:10.000000000 +0200
@@ -23,6 +23,13 @@
   }
 
   @Test
+  public void dump_data_invalid_outlines() throws IOException {
+    pdftk("test/files/issue123.pdf", "dump_data_utf8");
+    String expectedData = slurp("test/files/issue123.data");
+    assertEquals(expectedData, systemOut.getLog());
+  }
+
+  @Test
   public void idempotent() {
     pdftk("test/files/refs.pdf", "dump_data_utf8");
     String expectedData = systemOut.getLog();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/test/com/gitlab/pdftk_java/FormTest.java 
new/pdftk-v3.3.3/test/com/gitlab/pdftk_java/FormTest.java
--- old/pdftk-v3.3.2/test/com/gitlab/pdftk_java/FormTest.java   2021-12-20 
18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/test/com/gitlab/pdftk_java/FormTest.java   2022-09-22 
19:23:10.000000000 +0200
@@ -34,21 +34,21 @@
 
   @Test
   public void dump_data_fields_utf8_options() throws IOException {
-    pdftk("test/files/form-utf8.pdf", "dump_data_fields_utf8");
-    String expectedData = slurp("test/files/form-utf8.data");
+    pdftk("test/files/form-pdfdocencoding.pdf", "dump_data_fields_utf8");
+    String expectedData = slurp("test/files/form-pdfdocencoding.data");
     assertEquals(expectedData, systemOut.getLog());
   }
 
   @Test
   public void generate_fdf_utf8_options() throws IOException {
-    pdftk("test/files/form-utf8.pdf", "generate_fdf", "output", "-");
-    byte[] expectedData = slurpBytes("test/files/form-utf8.fdf");
+    pdftk("test/files/form-pdfdocencoding.pdf", "generate_fdf", "output", "-");
+    byte[] expectedData = slurpBytes("test/files/form-pdfdocencoding.fdf");
     assertArrayEquals(expectedData, systemOut.getLogAsBytes());
   }
 
   @Test
   public void fill_from_fdf_utf8_options() throws IOException {
-    pdftk("test/files/form-utf8.pdf", "fill_form", 
"test/files/form-utf8-filled.fdf", "output", "-");
+    pdftk("test/files/form-pdfdocencoding.pdf", "fill_form", 
"test/files/form-pdfdocencoding-filled.fdf", "output", "-");
   }
 
   @Test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pdftk-v3.3.2/test/files/form-pdfdocencoding-filled.fdf 
new/pdftk-v3.3.3/test/files/form-pdfdocencoding-filled.fdf
--- old/pdftk-v3.3.2/test/files/form-pdfdocencoding-filled.fdf  1970-01-01 
01:00:00.000000000 +0100
+++ new/pdftk-v3.3.3/test/files/form-pdfdocencoding-filled.fdf  2022-09-22 
19:23:10.000000000 +0200
@@ -0,0 +1,30 @@
+%FDF-1.2
+%????
+1 0 obj
+
+<<
+/FDF 
+<<
+/Fields [
+<<
+/T (Combo Box)
+/V (N?gonting)
+>> 
+<<
+/T (Radio Button)
+/V (A??)
+>> 
+<<
+/T (List Box)
+/V (N?gonting)
+>>]
+>>
+>>
+endobj
+
+trailer
+
+<<
+/Root 1 0 R
+>>
+%%EOF
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/test/files/form-pdfdocencoding.data 
new/pdftk-v3.3.3/test/files/form-pdfdocencoding.data
--- old/pdftk-v3.3.2/test/files/form-pdfdocencoding.data        1970-01-01 
01:00:00.000000000 +0100
+++ new/pdftk-v3.3.3/test/files/form-pdfdocencoding.data        2022-09-22 
19:23:10.000000000 +0200
@@ -0,0 +1,25 @@
+---
+FieldType: Button
+FieldName: Radio Button
+FieldFlags: 49152
+FieldValue: Off
+FieldJustification: Left
+FieldStateOption: A????
+FieldStateOption: Off
+FieldStateOption: All??
+---
+FieldType: Choice
+FieldName: List Box
+FieldFlags: 0
+FieldValue: N??gonting
+FieldJustification: Left
+FieldStateOption: N??gonting
+FieldStateOptionDisplay: N??gonting
+---
+FieldType: Choice
+FieldName: Combo Box
+FieldFlags: 131072
+FieldValue: N??gonting
+FieldJustification: Left
+FieldStateOption: N??gonting
+FieldStateOptionDisplay: N??gonting
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/test/files/form-pdfdocencoding.fdf 
new/pdftk-v3.3.3/test/files/form-pdfdocencoding.fdf
--- old/pdftk-v3.3.2/test/files/form-pdfdocencoding.fdf 1970-01-01 
01:00:00.000000000 +0100
+++ new/pdftk-v3.3.3/test/files/form-pdfdocencoding.fdf 2022-09-22 
19:23:10.000000000 +0200
@@ -0,0 +1,30 @@
+%FDF-1.2
+%????
+1 0 obj
+
+<<
+/FDF 
+<<
+/Fields [
+<<
+/T (Combo Box)
+/V (N?gonting)
+>> 
+<<
+/T (Radio Button)
+/V /Off
+>> 
+<<
+/T (List Box)
+/V (N?gonting)
+>>]
+>>
+>>
+endobj
+
+trailer
+
+<<
+/Root 1 0 R
+>>
+%%EOF
Binary files old/pdftk-v3.3.2/test/files/form-pdfdocencoding.pdf and 
new/pdftk-v3.3.3/test/files/form-pdfdocencoding.pdf differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/test/files/form-utf8-filled.fdf 
new/pdftk-v3.3.3/test/files/form-utf8-filled.fdf
--- old/pdftk-v3.3.2/test/files/form-utf8-filled.fdf    2021-12-20 
18:20:25.000000000 +0100
+++ new/pdftk-v3.3.3/test/files/form-utf8-filled.fdf    1970-01-01 
01:00:00.000000000 +0100
@@ -1,30 +0,0 @@
-%FDF-1.2
-%????
-1 0 obj
-
-<<
-/FDF 
-<<
-/Fields [
-<<
-/T (Combo Box)
-/V (N?gonting)
->> 
-<<
-/T (Radio Button)
-/V (A??)
->> 
-<<
-/T (List Box)
-/V (N?gonting)
->>]
->>
->>
-endobj
-
-trailer
-
-<<
-/Root 1 0 R
->>
-%%EOF
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/test/files/form-utf8.data 
new/pdftk-v3.3.3/test/files/form-utf8.data
--- old/pdftk-v3.3.2/test/files/form-utf8.data  2021-12-20 18:20:25.000000000 
+0100
+++ new/pdftk-v3.3.3/test/files/form-utf8.data  1970-01-01 01:00:00.000000000 
+0100
@@ -1,25 +0,0 @@
----
-FieldType: Button
-FieldName: Radio Button
-FieldFlags: 49152
-FieldValue: Off
-FieldJustification: Left
-FieldStateOption: A????
-FieldStateOption: Off
-FieldStateOption: All??
----
-FieldType: Choice
-FieldName: List Box
-FieldFlags: 0
-FieldValue: N??gonting
-FieldJustification: Left
-FieldStateOption: N??gonting
-FieldStateOptionDisplay: N??gonting
----
-FieldType: Choice
-FieldName: Combo Box
-FieldFlags: 131072
-FieldValue: N??gonting
-FieldJustification: Left
-FieldStateOption: N??gonting
-FieldStateOptionDisplay: N??gonting
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/test/files/form-utf8.fdf 
new/pdftk-v3.3.3/test/files/form-utf8.fdf
--- old/pdftk-v3.3.2/test/files/form-utf8.fdf   2021-12-20 18:20:25.000000000 
+0100
+++ new/pdftk-v3.3.3/test/files/form-utf8.fdf   1970-01-01 01:00:00.000000000 
+0100
@@ -1,30 +0,0 @@
-%FDF-1.2
-%????
-1 0 obj
-
-<<
-/FDF 
-<<
-/Fields [
-<<
-/T (Combo Box)
-/V (N?gonting)
->> 
-<<
-/T (Radio Button)
-/V /Off
->> 
-<<
-/T (List Box)
-/V (N?gonting)
->>]
->>
->>
-endobj
-
-trailer
-
-<<
-/Root 1 0 R
->>
-%%EOF
Binary files old/pdftk-v3.3.2/test/files/form-utf8.pdf and 
new/pdftk-v3.3.3/test/files/form-utf8.pdf differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pdftk-v3.3.2/test/files/issue123.data 
new/pdftk-v3.3.3/test/files/issue123.data
--- old/pdftk-v3.3.2/test/files/issue123.data   1970-01-01 01:00:00.000000000 
+0100
+++ new/pdftk-v3.3.3/test/files/issue123.data   2022-09-22 19:23:10.000000000 
+0200
@@ -0,0 +1,59 @@
+InfoBegin
+InfoKey: Creator
+InfoValue: wkhtmltopdf 0.12.6
+InfoBegin
+InfoKey: CreationDate
+InfoValue: D:20211231172637+01'00'
+InfoBegin
+InfoKey: Producer
+InfoValue: Qt 4.8.7
+InfoBegin
+InfoKey: Title
+InfoValue: QLatin1Char Class | Qt 4.8
+NumberOfPages: 2
+BookmarkBegin
+BookmarkTitle: Qt Documentation
+BookmarkLevel: 1
+BookmarkPageNumber: 1
+BookmarkBegin
+BookmarkTitle: Contents
+BookmarkLevel: 2
+BookmarkPageNumber: 1
+BookmarkBegin
+BookmarkTitle: QLatin1Char Class
+BookmarkLevel: 1
+BookmarkPageNumber: 1
+BookmarkBegin
+BookmarkTitle: Public Functions
+BookmarkLevel: 2
+BookmarkPageNumber: 1
+BookmarkBegin
+BookmarkTitle: Detailed Description
+BookmarkLevel: 2
+BookmarkPageNumber: 1
+BookmarkBegin
+BookmarkTitle: Member Function Documentation
+BookmarkLevel: 2
+BookmarkPageNumber: 1
+BookmarkBegin
+BookmarkTitle: QLatin1Char::QLatin1Char(char c)
+BookmarkLevel: 3
+BookmarkPageNumber: 1
+BookmarkBegin
+BookmarkTitle: char QLatin1Char::toLatin1() const
+BookmarkLevel: 3
+BookmarkPageNumber: 1
+BookmarkBegin
+BookmarkTitle: ushort QLatin1Char::unicode() const
+BookmarkLevel: 3
+BookmarkPageNumber: 1
+PageMediaBegin
+PageMediaNumber: 1
+PageMediaRotation: 0
+PageMediaRect: 0 0 595 842
+PageMediaDimensions: 595 842
+PageMediaBegin
+PageMediaNumber: 2
+PageMediaRotation: 0
+PageMediaRect: 0 0 595 842
+PageMediaDimensions: 595 842
Binary files old/pdftk-v3.3.2/test/files/issue123.pdf and 
new/pdftk-v3.3.3/test/files/issue123.pdf differ

Reply via email to