I am using openHTMLtoPDF to convert my HTML to PDF. I have given full path to my images therefore , I don't want teh library to use a base path.
Ex: path of my image is: C:\Users\hmt\Desktop\pdf\email_icon.png
PdfRendererBuilder builder = new PdfRendererBuilder();
builder.useFastMode();
builder.withHtmlContent(template, "file:\\");
builder.toStream(baos);
builder.run();
return baos;
}
I am getting the following error:
When trying to load uri(C:\Users\hmt\Desktop\pdf\email_icon.png) with base URI(file:\), one or both were invalid URIs.
com.openhtmltopdf.load INFO:: URI resolver rejected loading image at (C:\Users\hmt\Desktop\pdf\email_icon.png)
baseDocumentUri can be null if there are no relative resources.