Html to PDF - Load and Save to Stream

How can I convert HTML file to PDF by loading and saving to Stream?

Thanks.

Hi there,


Thanks for your inquiry. Please check following sample code snippet for loading and saving HTML to PDF conversion using stream. Hopefully it will help you to accomplish the task. Please also check HTML to PDF conversion documentation link for further details.

// Open the
stream<o:p></o:p>

InputStream stream = new FileInputStream(myDir+ "test.html");

Document doc = new Document(stream,new HtmlLoadOptions());

ByteArrayOutputStream dstStream = new ByteArrayOutputStream();

doc.save(dstStream);


Best Regards,