Hi,
You have to load from a file or from a stream (loading from byte array
should also work). You should not pass the same output stream as before.
If it still doesn't work, please create a minimal project.
Tilman
Am 17.12.2021 um 14:28 schrieb Oleksandr Kiselev:
Hello everyone.
I encountered the following problem and was hoping you would help me.
I convert html to pdf using openhtmltopdf
```java
try(ByteArrayOutputStream os = new ByteArrayOutputStream()) {
PdfRendererBuilder builder = new PdfRendererBuilder();
builder.toStream(os);
builder.withHtmlContent(html,"");
builder.run();
return os.toByteArray();
}
```
I then create PDDocument using PDDocument.load(os.toByteArray());
When I try to sign it I pass newly created OutputStream and use it to
create pdf file.
Unfortunately, I got an error. My signature is invalid because the content
of the original file and signed file is not the same.
It works when I create pdf File in the filesystem and use
PDDocument.load(inFile)
I don't want to create an input file in the filesystem. Is there a way to
do that in memory working directly with bytes using streams?
Thank you very much
Best regards,
Oleksandr
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org