[
https://issues.apache.org/jira/browse/PDFBOX-3322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15272210#comment-15272210
]
Tilman Hausherr commented on PDFBOX-3322:
-----------------------------------------
The template document could be used several times, then closing it in
addSignature() wouldn't be good.
Currently the COSDocument is built here:
{code}
public void setSignatureProperties(String name, String location, String
reason, int preferredSize,
int page, boolean visualSignEnabled) throws IOException
{
visibleSignatureProperties.signerName(name).signerLocation(location).signatureReason(reason).
preferredSize(preferredSize).page(page).visualSignEnabled(visualSignEnabled).
setPdVisibleSignature(visibleSignDesigner).buildSignature();
}
{code}
I always prefer that stuff is closed where it is created, so closing
visibleSignatureProperties would probably be the best, and closing options is
the second best. Closing it in addSignature() would make signing even more
confusing than it already is.
> Warning "You did not close a PDF Document" when visual signature is added
> -------------------------------------------------------------------------
>
> Key: PDFBOX-3322
> URL: https://issues.apache.org/jira/browse/PDFBOX-3322
> Project: PDFBox
> Issue Type: Improvement
> Components: PDModel, Signing
> Affects Versions: 1.8.11
> Reporter: Petras
> Assignee: Tilman Hausherr
> Labels: signature
> Fix For: 1.8.13
>
> Attachments: PDFBOX_3322_VisualSignatureClosing.patch
>
>
> When visual signature is added, warning "You did not close a PDF Document" is
> added to the output log. It appears, that _VisualSignatureParser_ creates an
> instance of _COSDocument_ and later is held by _SignatureOptions_, but for
> this instance the {{#close()}} method is never called, which results to that
> warning reported by its {{#finalize()}} method.
> Probably it should by closed by _PDDocument_ when used after signing.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]