I am using wkhtmltoPDF to generate pdf from html string and It works fine for me as expected, but now I have to generate output as Image and I'm unable to find sample code or any library.
I have referred https://github.com/jhonnymertz/java-wkhtmltopdf-wrapper to generate pdf.
import com.github.jhonnymertz.wkhtmltopdf.wrapper.Pdf;
public class WKhtmlToPdf
{
Pdf pdf = new Pdf();
pdf.addPageFromString("html code");
pdf.addToc();
try{
pdf.saveAs("Output.pdf");
}
catch (IOException e)
{
}
catch (InterruptedException e)
{
}
}
I wanted an output an Image. Can any one tell me and I don't want to use Runtime.getRuntime().exe() method to generate output.
Thanks in advance.