I am trying to convert an html report to pdf (Java aspose.word product) but the column widths and wrapping are not being converted properly. I am wondering if I can control this to make a readable pdf? With a prior product, I was able to use setHtmlWidth() to help control but event without that, the results were better. I am hoping to use this product so please let me know what I can do.
I tried using PdfSaveOptions with (setZoomBehaviour./setZoomFactor) but I don’t see any differences. The code I am using follows …
Document doc = new Document("testHtml.html");
// easiest way to save to file
//doc.save("aspose.doc");
// using output stream
ByteArrayOutputStream out = new ByteArrayOutputStream();
// trying options
PdfSaveOptions options = new PdfSaveOptions();
options.setCompliance(PdfCompliance.PDF_A_1_B);
options.setZoomBehavior(PdfZoomBehavior.FIT_WIDTH);
options.setZoomFactor(50);
doc.save(out, options);
byte[] dataForWriting = out.toByteArray();
FileUtils.writeByteArrayToFile(new File("testHtml.pdf"), dataForWriting);
–
I have also tried with just this …
Document doc = new Document("testHtml.html");
// easiest way to save to file
//doc.save("aspose.doc");
Please find before (html) and after (pdf) attached…
testHtml.zip (54.4 KB)