While trying to convert html to pdf. There are unexpected page breaks occuring. Unable to avoid random page breaks.
public InputStream convertHtmlToPdf(InputStream htmlInputStream) throws Exception {
String baseName = UUID.randomUUID().toString();
String sourceFileName = baseName + ".html";
String targetFileName = baseName + ".pdf";
this.convertFile(sourceFileName, targetFileName, htmlInputStream);
try {
return this.downloadFile(targetFileName);
} finally {
this.deleteFileQuietly(targetFileName);
}
}