"Reporting" is overlapped with "Benchmark" text in Cervical Cancer Screens and Mammography table

Hello Aspose team ,
We convert our excel file to docX then convert it into a doc file. After converting the excel file into docX, the “Reporting” is overlapped with “Benchmark” text
Lifestyle Management-docx.docx (170.4 KB)
Lifestyle Management Excel .xlsx.zip (73.9 KB)

Following is an executable code snippet:

Workbook workbook = new Workbook("/Users/nitesh.kc/Desktop/Lifestyle Management Excel.xlsx")
        workbook.calculateFormula();
        def counter = 0, remain =0
        def except = "P_Display"
        while (workbook.getWorksheets().getCount() != remain){
            if (workbook.worksheets.get(counter)?.visible == false) {
                workbook.worksheets.removeAt(counter)
            } else if (except && workbook.worksheets.get(counter)?.name != except) {
                workbook.worksheets.removeAt(counter)
            } else {
                counter++
                remain++
            }

        }
        workbook.save("/Users/nitesh.kc/Desktop/excel_after_remove_sheet1.xlsx")

         workbook = new Workbook("/Users/nitesh.kc/Desktop/excel_after_remove_sheet1.xlsx")
        ByteArrayOutputStream dstStream = new ByteArrayOutputStream();
        workbook.save(dstStream, SaveFormat.DocX);
        ByteArrayInputStream srcStream = new ByteArrayInputStream(dstStream.toByteArray());
        Document tempDocument = new Document(srcStream)
        tempDocument.save("/Users/nitesh.kc/Desktop/Lifestyle Management-docx.docx")

Please let us know if anything is missing or needed for more clarification.

@NiteshCG I tried converting you XLS file to DOCX using the latest version of Aspose.Cells and I do not observe the problem you have described. I used the following code for testing:

Workbook workbook = new Workbook("C:\\Temp\\in.xlsx");
workbook.calculateFormula();
workbook.save("C:\\Temp\\out.docx", com.aspose.cells.SaveFormat.DOCX);

Could you please attach DOCX document produced on your side while converting from Excel to Word before processing it using Aspose.Words?

While converting the excel file, we first convert excel file into pdf file and then we convert it into doc file.
The issue is pointed out in below screenshot.

The aspose version used are:

  • Name: ‘aspose-words’, version: ‘22.9’
  • Name: ‘aspose-cells’, version: ‘22.9’
  • Name: aspose-pdf’, version: ‘22.8’

Following is an executable code snippet:

Workbook workbook = new Workbook("/Users/nitesh.kc/Desktop/input_excel.xlsx")
workbook.calculateFormula();
def counter = 0, remain =0
def except = "P_Display"
while (workbook.getWorksheets().getCount() != remain){
    if (workbook.worksheets.get(counter)?.visible == false) {
        workbook.worksheets.removeAt(counter)
    } else if (except && workbook.worksheets.get(counter)?.name != except) {
        workbook.worksheets.removeAt(counter)
    } else {
        counter++
        remain++
    }
}
workbook.save("/Users/nitesh.kc/Desktop/excel_after_remove_sheet1.xlsx")
workbook = new Workbook("/Users/nitesh.kc/Desktop/excel_after_remove_sheet1.xlsx")
ByteArrayOutputStream dstStream = new ByteArrayOutputStream();
workbook.save(dstStream, SaveFormat.PDF);
ByteArrayInputStream srcStream = new ByteArrayInputStream(dstStream.toByteArray());
Document tempDocument = new Document(srcStream)
tempDocument.save("/Users/nitesh.kc/Desktop/output_pdf.pdf")
Locale.setDefault(new Locale('en-us'));
document = new Document('/Users/nitesh.kc/Desktop/output_pdf.pdf')
document.save('output_doc.docx', SaveFormat.DocX)

The input file( input_excel.xlsx.zip ) and output file (output_doc.docx )are attached along this ticket.

@NiteshCG Thank you for additional information. It looks like the problem occurs upon conversion from PDF to DOCX using Aspose.PDF. So I will move your request to Aspose.PDF forum. My colleagues will hep you shortly.
Also, conversion Excel->PDF->Word looks like a very complicated way of Excel to Word conversion. PDF as an intermediate format might not allow to properly build MS Word document due to the different in PDF and Word documents models. One one hand PDF documents are fixed page documents, i.e. there are pages and all content elements are absolutely positioned on the pages. On other hand Word documents are flow documents and do not have page concept, the consumer application layouts the document into pages on the fly. This makes PDF format a superior for viewing since it looks the same on any device with any set of fonts, and Word document are good for editing since document is reflowed once it is edited.
This difference in PDF and Word documents makes it difficult and sometimes impossible to provide 100% fidelity after conversion for PDF to Word.

All of the documents in our project have been converted from excel to PDF and then from PDF to Word for the purpose of putting up the header, footer, and logo. Therefore, we have been using this implementation for a while. This implementation is working for all others cases, except this one.

Please provide me with an update on this.

@NiteshCG

We have reproduce the issue in our environment using 22.9 version of the API. However, in our environment, the text was not overlapped but misplaced. Therefore, an issue as PDFJAVA-42099 has been logged in our issue tracking system. We will further look into its details and let you know as soon as the ticket is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.

1 Like

Is there any update on this?

@NiteshCG

The ticket already has the highest priority and is being investigated at the moment. We will surely inform you in the respective forum thread in paid support forum once we make some progress towards its resolution. Please spare us some time.

Any updates available on this?

@NiteshCG

The issue already has maximum available priority and is under the phase of investigation. As soon as we complete the analysis, we will be able to share some updates with you. Please spare us some time.

We are sorry for the inconvenience.

@asad.ali

Any update on this?

@anilmhjn

The ticket is being investigated at the moment and as soon as its completely investigated, we will be able to share some updates with you. Please spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFJAVA-42099) have been fixed in Aspose.PDF for Java 23.2.