Can we convert a html file to pdf file by passing the file as input?

Product: html2pdf

Product Version: 9.4

Please give a brief summary of your issue:
Can we convert a html file to pdf file by passing the file as input?

Hello,

Yes it is possible to pass the file as an input. You can set the file path into the InsertFromURL method. Please see the API here and refer to the guide below:

Hey @shakthi124 I need help with Java API

I tried it but am getting error to setModule :
PDFDoc doc = new PDFDoc();
HTML2PDF converter = new HTML2PDF();
HTML2PDF.WebPageSettings settings = new HTML2PDF.WebPageSettings();
settings.setPrintBackground(false);
converter.insertFromURL(sourecePath + “Sample.html”, settings);

Is there an option to pass the source document as inputStream (Java API)?