You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Manu Schiller (JIRA)" <ji...@apache.org> on 2017/05/01 16:07:05 UTC
[jira] [Comment Edited] (PDFBOX-3771) Signing example does not work
if inFile = outFile
[ https://issues.apache.org/jira/browse/PDFBOX-3771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15991003#comment-15991003 ]
Manu Schiller edited comment on PDFBOX-3771 at 5/1/17 4:06 PM:
---------------------------------------------------------------
Ok thanks, did not know that. So on UNIX-based systems (we only run this on our server) I would simply do:
{code:java}
// again line 215
signing.signDetached(inFile, outFile, tsaClient);
outFile.renameTo(inFile);
{code}
thanks a lot :)
was (Author: manuschiller):
Ok thanks, did not know that. So on UNIX-based systems (we only run this on our server) I would simply just do:
{code:java}
// again line 215
signing.signDetached(inFile, outFile, tsaClient);
outFile.renameTo(inFile);
{code}
thanks a lot :)
> Signing example does not work if inFile = outFile
> -------------------------------------------------
>
> Key: PDFBOX-3771
> URL: https://issues.apache.org/jira/browse/PDFBOX-3771
> Project: PDFBox
> Issue Type: Bug
> Components: Signing
> Affects Versions: 2.0.5
> Environment: Mac, JDK8
> Reporter: Manu Schiller
> Priority: Minor
>
> Hi,
> I tried using the Signature example (https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/) which works great for certifying pdfs.
> However if I want to certify and replace the original pdf without creating a new one (like foo_signed.pdf should only be foo.pdf), I get an exception:
> `Exception in thread "main" java.io.IOException: Error: End-of-File, expected line pdfbox`
> I invoked the method like this (L215 of CreateSignature.java):
> `signing.signDetached(inFile);`
> How would I change the example so that I can certify pdfs without creating copy files?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org