Free Support Forum - aspose.com

Cells hangs when converting xml file to PDF with self-closing Styles tag

An xml (Excel) file with an empty, self-closing Styles tag, i.e., <Styles />, results in Cells hanging when loading the file. Unfortunately it does not fail, and results in resources not being released. Changing the tag to be <Styles></Styles> works.

This is fairly critical.

Version: Cells for Java, v18.3

Example file…

    <?xml version="1.0"?>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
     xmlns:o="urn:schemas-microsoft-com:office:office"
     xmlns:x="urn:schemas-microsoft-com:office:excel"
     xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
     xmlns:html="http://www.w3.org/TR/REC-html40">
     <Styles />
     <Worksheet ss:Name="Sheet1 %">
      <Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="1" x:FullColumns="1"
       x:FullRows="1" ss:DefaultColumnWidth="65" ss:DefaultRowHeight="16">
       <Column ss:Width="255"/>
       <Column ss:Width="471"/>
       <Row>
        <Cell><Data ss:Type="String">test</Data></Cell>
       </Row>
      </Table>
      <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
       <PageSetup>
        <Header x:Margin="0.3"/>
        <Footer x:Margin="0.3"/>
        <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
       </PageSetup>
       <Selected/>
       <ProtectObjects>False</ProtectObjects>
       <ProtectScenarios>False</ProtectScenarios>
      </WorksheetOptions>
     </Worksheet>
    </Workbook>

Regards,
Nathan

@idbs,

Thanks for the details and XML file contents.

After an initial test, I am able to observed the issue as you mentioned. Aspose.Cells hangs when converting a SpreadsheetML file (xml) to PDF with self-closing Styles tag. I created an XML Spreadsheet 2003 file (.xml) by copying the file contents you pasted into a new file and save the XML file. Now I used the following sample code to try to convert the file to PDF:
e.g
Sample code:

Workbook wb = new Workbook("f:\\files\\test.xml"); 
wb.save("f:\\files\\out1.pdf");

I have logged a ticket with an id “CELLSJAVA-42644” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.
test1.zip (604 Bytes)

@idbs

Thanks for using Aspose APIs.

This is to inform you that we have fixed your issue CELLSJAVA-42644 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Excellent - thanks for the quick response!

Hi,
Is there a rough ETA for the release with this fix?
Regards,
Nathan

@idbs,

We are scheduled to release our next official version (e.g Aspose.Cells for Java v18.6) before the end the next week (hopefully) or so. The release will include the fix of your issue. There is no exact release date, the releases are published when ready.

By the way, in the mean time we might publish an interim fix (in the next 2-3 days) and share with you here.

Thanks for the information!
Nathan

@idbs

Thanks for using Aspose APIs.

Please download and try the following fix for your issue CELLSJAVA-42644 and let us know your feedback.

Hi

The zip doesn’t seem to decompress correctly - it extracts to a cpgz file, which then converts back to a zip.

Regards,
Nathan

@idbs,

Please use some Zip tool to extract the Aspose.Cells for Java Jar from zipped archive. I tested using WinRar tool and it extracts the Jar fine. May be you need to re-download the zipped archive as it was not downloaded properly previously due to bad network.

Thanks - it turns out I needed someone on a Windows machine to download and extract the zip.

@idbs,

Ok, I think you got it right now. By the way, we are scheduled to publish our next official version before the end of next week or so. The next version (v18.6) will also include the fix of your issue, so you may get it from maven repos. without any issue on your environment.

The issues you have found earlier (filed as CELLSJAVA-42644) have been fixed in Aspose.Cells for Java 18.6. Please also see the document for your reference: https://docs.aspose.com/display/cellsjava/Installation