[ 
https://issues.apache.org/jira/browse/PDFBOX-2720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14618525#comment-14618525
 ] 

Petras commented on PDFBOX-2720:
--------------------------------

It appears that incremental update of PDF with cross-reference stream does not 
include *Prev* entry into the cross-reference stream dictionary. See the method 
COSWriter#doWriteXRefInc#622 which removes it:
{{trailer.removeItem(COSName.PREV);}}
but do not updates it with the value of *startxref* keyword from the previous 
document revision.
It start to work if I replace it with:
{{trailer.setLong(COSName.PREV, doc.getStartXref());}}

> Can't sign PDF document with forms or annotations
> -------------------------------------------------
>
>                 Key: PDFBOX-2720
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2720
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Signing
>    Affects Versions: 2.0.0
>            Reporter: Cyril Bremaud
>            Assignee: Andreas Lehmkühler
>            Priority: Blocker
>         Attachments: Doc1WithSignForms.pdf, Doc1WithSignForms.pdf_signed.pdf, 
> Doc2.pdf, Doc2.pdf_signed.pdf, Doc3WithAnnot.pdf, 
> Doc3WithAnnot.pdf_signed.pdf, Doc3WithoutAnnot.pdf, 
> Doc3WithoutAnnot.pdf_signed.pdf
>
>
> It is not possible to sign a PDF document which contains a form.
> There is no exception traces.
> Please find attached 8 documents :
> * A document with a visual signature form (does not work) (Doc1)
> * A probably latex generated document (does not work) (Doc2)
> * A document with an annotation (does not work) (Doc3WithAnnot)
> * And the same document without annotation ( which works well ) 
> (Doc3WithoutAnnot)
> * And their signed release.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to