I tried to convert html to pdf using your product but it is not working in case of that html size is over than about 1.2M.
Spire.PDF for Java version is 10.9.0. and working on OS Win11, RAM 16GB, JDK1.8 environment.
the test code is following.
- Code: Select all
try (
FileInputStream fis = new FileInputStream(Paths.get("C:\\tools\\test1.html").toFile());) {
String htmlString = IOUtils.toString(fis, "UTF-8");
String outputFile = "C:\\tools\\test.pdf";
HtmlConverter.setPluginPath("C:\\tools\\plugins-windows-x64\\plugins");
HtmlConverter.convert(htmlString, outputFile, true, 1000000, new Size(700, 500), new PdfMargins(0),
LoadHtmlType.Source_Code);
} catch (IOException e) {
e.printStackTrace();
}
I attached 2 html files, test1.html can be converted to PDF file well, but pdf file is not generated for test2.html with no errors, exceptions.
Do you have any restrictions or options for using HtmlConverter?
thanks.