Hello Aspose Team,
When we create the word file from template(excel), issue is occurred on layout of generated docx file as text value overlapped. However, there is no issue on pdf file generated from same template. Here we attached the sample-code we have used, template with demo data, generated word & pdf file and screen shot of word file with marking (red-circle) issue generated point on zipped file. Could you please look into this from your side.wordGenerateProperly.zip (540.2 KB)
Sample Code:
try {
FileInputStream io1=new FileInputStream(new File("TemplateWithDemoData.xlsx"));
Workbook workbook1 = new Workbook(io1);
workbook1.save("temporary_saved_templateFile.xlsx");
FileInputStream io = new FileInputStream(new File("temporary_saved_templateFile.xlsx"));
Workbook workbook = new Workbook(io);
workbook.calculateFormula();
for (int m = 0; m < workbook.getWorksheets().getCount(); m++) {
workbook.getWorksheets().get(m).getShapes().updateSelectedValue();
}
for (int j = 0; j < workbook.getWorksheets().getCount(); j++) {
def sheetName = workbook.getWorksheets().get(j).getName();
if ((sheetName.startsWith("_") || sheetName.contains("staging") || sheetName.contains("Staging"))) {
workbook.getWorksheets().get(j).setVisible(false);
}
}
workbook.save("PDF_file_result.pdf");
Document pdfDocument=new Document("PDF_file_result.pdf")
pdfDocument.save("WORD_file_result3.docx",com.aspose.pdf.SaveFormat.DocX);
} catch (Exception e) {
e.printStackTrace();
}