Hi,
We are using Aspose Words to combine a couple of html documents and then export them as a single pdf file.
The problem is that, for the second html document, which has a table with a lot of columns, some of the columns are missing in the combined output pdf.
When I only export the second html to pdf, all the columns are visible, so seems that there is some scaling happening when both are combined together.
Could someone help with the above, in terms of how to make sure the combined pdf displays all the data?
Note: I found, that when I change the order of inserting the documents, i.e inserting the second html file (i.e. the bigger file) first, followed by the first html file, the combined pdf also displays everything. So may be, the first inserted document’s width sizing is somehow used? We obviously cannot use this solution as we do not know which of the input html files will be bigger or more wider.
Rough Java code of how it executes currently:
DocumentBuilder documentBuilder = documentBuilderProvider.get();
Document firstHtmlDocument = new Document(firstHtmlInputStream, new LoadOptions(LoadFormat.HTML, null, null));
Document secondHtmlDocument = new Document(firstHtmlInputStream, new LoadOptions(LoadFormat.HTML, null, null));
documentBuilder.insertDocument(firstHtmlDocument, ImportFormatMode.KEEP_SOURCE_FORMATTING);
documentBuilder.insertDocument(secondHtmlDocument, ImportFormatMode.KEEP_SOURCE_FORMATTING);
documentBuilder.getDocument().save(outputStream, new PdfSaveOptions());
The attached zip files contains the two html files and also the output pdf ‘combinedOutput.pdf’ that shows the problem. Also got another pdf file, that shows how the formatting issue disappears when the html file with lots of table columns is inserted first as mentioned in the Note section.
TestFiles.zip (141.8 KB)