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

Reply via email to