Hi Sharon,
Thanks for sharing the detail. I have tested the scenario using latest version of Aspose.Words for Java 14.11.0 and have not found the performance issue. I have used the following method to create the table and export final document to Pdf.
private static void testConvert(int count) throws Exception {
long time = System.currentTimeMillis();
// FileInputStream fis = new FileInputStream(new File(MyDir + "table_data_" + count + ".docx"));
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.startTable();
for (int i = 0; i < count; i++) {
builder.insertCell();
builder.write("Row 1, Cell 1 Content.");
// Build the second cell
builder.insertCell();
builder.write("Row 1, Cell 2 Content.");
// Call the following method to end the row and start a new row.
builder.endRow();
}
builder.endTable();
OutputStream outstream = new ByteArrayOutputStream();
PdfSaveOptions opt = new PdfSaveOptions();
opt.getOutlineOptions().setDefaultBookmarksOutlineLevel(9);
doc.save(outstream, opt);
System.out.println("Time taken to convert " + count + " rows : " + (System.currentTimeMillis()-time));
}
It is quite difficult to answer such
questions because performance and memory usage all depend on complexity
and size of the documents you are generating. While rendering a document to fixed page formats (e.g. PDF), Aspose.Words needs to build two model in the memory – one for document and the other for rendered document.
Please note that the process of building layout model is
not linear; it may take a minute to render one page and may take a few
seconds to render 100 pages. Also, Aspose.Words has to create APS (Aspose Page Specification)
model in memory and this may again eat some more time for some
documents. Rest assured, we’re always working on improving performance;
but, rendering will be always running slower than simple saving to flow
formats (e.g doc/docx).