You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Kai Keggenhoff <ke...@conclude.com> on 2019/03/01 08:48:35 UTC

PDFBox 2.0.14 and JIRA-4437 - import stamp annotations from XFDF

Hello,

this morning I read about the release of 2.0.14 and when I noticed the entry for PDFBOX-4437, I was rather happy, because this was an issue for some of our users.
However, after putting 2.0.14 to the test, my enthusiam was curbed, because by all appearances, the situation became worse.

https://www.dropbox.com/s/wzbyqjzua5zlk7k/lorem.zip?dl=0

Here I have provided four files with which I would like to demonstrate the problem.

lorem_1.pdf :

this is the original, unmodified PDF.

lorem_2_with_upload_button_and_stamp.pdf :

this is the PDF we deliver to the user. In the upper left corner is a button which will upload the annotations made by the user to our server.
In this case, it will upload the XFDF to a local address, which is not available outside my test scenario (and in the live enviroment, the button is more serious).

I already added a stamp annotation with the picture of the word "Genehmigt" (German for "approved")

lorem.xfdf :

this is the XFDF uploaded to the server

lorem_3_merged.pdf :

this is the original PDF with the XFDF merged into it.
Opening this PDF with Adobe Acrobat Read DC produces the error message

"There was an error processing an annotation or link. There was a problem reading this document (16)."

The regular content is displayed normally though and the outline of the stamp can be seen if it's manually selected via the annotation list.
Merging the annotation with 2.0.13 produces no error message and a visible, but crossed out box for the stamp.

Merging the annotation is done by :


  1.  parsing the XFDF to a Document
  2.  creating a FDFDocument object with the Document
  3.  iterating over the list of FDFAnnotations obtained by FDFDocument.getCatalog().getFDF().getAnnotations() and adding each FDFAnnotation via  PDPage.getAnnotations().add(FDFAnnotation)

During this, 2.0.14 produces this console output :

Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: Group => NOT handling child element: BOOL
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: Group => NOT handling child element: BOOL
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: GS0 => NOT handling child element: BOOL
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: GS0 => NOT handling child element: FIXED
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: GS0 => NOT handling child element: FIXED
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: GS1 => NOT handling child element: BOOL
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: GS1 => NOT handling child element: INT
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: GS1 => NOT handling child element: INT
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: P0 => NOT handling child element: ARRAY
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: P0 => NOT handling child element: INT
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: Shading => NOT handling child element: ARRAY
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: Shading => NOT handling child element: ARRAY
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: Function => NOT handling child element: ARRAY
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: Function => NOT handling child element: ARRAY
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: Function => NOT handling child element: ARRAY
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: Function => NOT handling child element: INT
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: Function => NOT handling child element: ARRAY
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
WARNUNG: Shading => NOT handling child element: INT
Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseStreamElement
WARNUNG: N => Not handling element DATA encoding: ASCII

Best regards,

Kai Keggenhoff

Re: PDFBox 2.0.14 and JIRA-4437 - import stamp annotations from XFDF

Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,

Sorry about the problem. I'll investigate. I was able to reproduce it. 
 From a first look, I suspect that the code doesn't consider all items 
in a COSDictionary, only all items in a COSStream, and so the shading 
dictionary is empty. We'll see what happens when these are added. I'll 
create an issue later and let you know.

Tilman

Am 01.03.2019 um 09:48 schrieb Kai Keggenhoff:
> Hello,
>
> this morning I read about the release of 2.0.14 and when I noticed the entry for PDFBOX-4437, I was rather happy, because this was an issue for some of our users.
> However, after putting 2.0.14 to the test, my enthusiam was curbed, because by all appearances, the situation became worse.
>
> https://www.dropbox.com/s/wzbyqjzua5zlk7k/lorem.zip?dl=0
>
> Here I have provided four files with which I would like to demonstrate the problem.
>
> lorem_1.pdf :
>
> this is the original, unmodified PDF.
>
> lorem_2_with_upload_button_and_stamp.pdf :
>
> this is the PDF we deliver to the user. In the upper left corner is a button which will upload the annotations made by the user to our server.
> In this case, it will upload the XFDF to a local address, which is not available outside my test scenario (and in the live enviroment, the button is more serious).
>
> I already added a stamp annotation with the picture of the word "Genehmigt" (German for "approved")
>
> lorem.xfdf :
>
> this is the XFDF uploaded to the server
>
> lorem_3_merged.pdf :
>
> this is the original PDF with the XFDF merged into it.
> Opening this PDF with Adobe Acrobat Read DC produces the error message
>
> "There was an error processing an annotation or link. There was a problem reading this document (16)."
>
> The regular content is displayed normally though and the outline of the stamp can be seen if it's manually selected via the annotation list.
> Merging the annotation with 2.0.13 produces no error message and a visible, but crossed out box for the stamp.
>
> Merging the annotation is done by :
>
>
>    1.  parsing the XFDF to a Document
>    2.  creating a FDFDocument object with the Document
>    3.  iterating over the list of FDFAnnotations obtained by FDFDocument.getCatalog().getFDF().getAnnotations() and adding each FDFAnnotation via  PDPage.getAnnotations().add(FDFAnnotation)
>
> During this, 2.0.14 produces this console output :
>
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: Group => NOT handling child element: BOOL
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: Group => NOT handling child element: BOOL
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: GS0 => NOT handling child element: BOOL
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: GS0 => NOT handling child element: FIXED
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: GS0 => NOT handling child element: FIXED
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: GS1 => NOT handling child element: BOOL
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: GS1 => NOT handling child element: INT
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: GS1 => NOT handling child element: INT
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: P0 => NOT handling child element: ARRAY
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: P0 => NOT handling child element: INT
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: Shading => NOT handling child element: ARRAY
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: Shading => NOT handling child element: ARRAY
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: Function => NOT handling child element: ARRAY
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: Function => NOT handling child element: ARRAY
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: Function => NOT handling child element: ARRAY
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: Function => NOT handling child element: INT
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: Function => NOT handling child element: ARRAY
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseDictElement
> WARNUNG: Shading => NOT handling child element: INT
> Mär 01, 2019 9:35:12 AM org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp parseStreamElement
> WARNUNG: N => Not handling element DATA encoding: ASCII
>
> Best regards,
>
> Kai Keggenhoff
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


AW: PDFBox 2.0.14 and JIRA-4437 - import stamp annotations from XFDF

Posted by Kai Keggenhoff <ke...@conclude.com>.
Thanks for the quick fix.
Looking forward to 2.0.15 :)

Have a nice weekend !

-----Ursprüngliche Nachricht-----
Von: Tilman Hausherr <TH...@t-online.de> 
Gesendet: Freitag, 1. März 2019 12:07
An: users@pdfbox.apache.org
Betreff: Re: PDFBox 2.0.14 and JIRA-4437 - import stamp annotations from XFDF

https://issues.apache.org/jira/browse/PDFBOX-4478

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: PDFBox 2.0.14 and JIRA-4437 - import stamp annotations from XFDF

Posted by Tilman Hausherr <TH...@t-online.de>.
https://issues.apache.org/jira/browse/PDFBOX-4478

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org