Xps files produced by aspose.cells print very slowly indeed

Using aspose.cells 18.3

The attached zip file contains two folders, TestData and PrintApp

The .\TestData folder contains three files.

  • the source document A3 Excel Doc.xlsx
  • An xps file created by opening the xlsx inside aspose.cells and then saving to xps.
  • An xps file created by opening the xlsx file inside Excel and exporting to xps.

The .\PrintApp folder contains a tiny C# project that builds to a command-line app that takes the xps file named on the command line and sends it to the default printer queue.

The xps created by aspose takes very much longer to print than the xps created by Excel. On a Win7 machine, the aspose xps took over 6 minutes compared to 10s for the excel xps.

The speed was slightly better on my Win8.1 machine, but still not acceptable.

I would like the xps produced by aspose cells to print much faster.

Upload.zip (619.3 KB)

@Brian_THOMAS,

Thanks for the sample project and template files.

I noticed the issue and found the XPS file created by Aspose.Cells APIs takes more time while printing. I tried your scenario/ case using our latest version/fix, it works a bit better. Could you try our latest version/fix if it suits your needs: Aspose.Cells for .NET v18.9.5

Let us know if you find it still takes more than and not acceptable to you.

Hi Amjad,

Thank you for the download. To exercise the aspose.cells library I modified the little app that I sent you. Originally It sent an existing xps file to print. Now instead it opens the named xlsx file using aspose.cells, saves as a temp xps then sends that xps to print.

I did builds using three different aspose.cells versions: 18.3.0, 18.9.0 and 18.9.5, and did some timing comparisons printing on a Win7 x64 VM. Each timing is the length of time the job is in the printer queue before it disappears.

18.3.0   3m14s,  3m17s 
18.9.0   3m57s,  4m04s
18.9.5   3m59s

From the tests I did, both 18.9 versions produce xps that prints markedly slower than 18.3.0 whose behaviour I originally reported.

So please would you keep this issue open. I’d like aspose.cells to produce xps that prints in around 10s or less, like the xps exported directly from Excel, so a significant improvement is still required.

@Brian_THOMAS,

Thanks for providing further details.

As we noticed the issue you mentioned, a ticket is logged with an id “CELLSNET-46395” for your issue. We will evaluate your issue in details and try to enhance the printing/rendering XPS module.

Once we have an update on it, we will let you know here.

@Brian_THOMAS,

We found different results with different printers. Could you provide details which printer you used on your side where you find the big difference. This will help us really to evaluate your issue precisely to figure it out soon.

My target printer for testing was Ghostscript PDF - which is based on the in-box Unidrv driver.

If you compare the <FixedPage> content produced by aspose and Excel, the aspose content uses <Canvas> when it doesn’t really need to. For instance, at the start of the <FixedPage> there’s this, which is benign but really doesn’t need to be there:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <FixedPage xmlns="http://schemas.microsoft.com/xps/2005/06" xmlns:x="http://schemas.microsoft.com/xps/2005/06/resourcedictionary-key" xml:lang="en-us" Width="1587.84000651" Height="1122.239990234" Name="Page1">
    <Canvas RenderTransform="1.333333373,0,0,1.333333373,0,0">
      <Canvas>
        <Canvas>
        <Canvas />
      </Canvas>
      <Canvas>
      <Canvas />
    </Canvas>
    <Canvas>
    <Canvas />
  </Canvas>
</Canvas>

Later on in the same <FixedPage> there’s a construct like this, where each <Path> exists within its own <Canvas> - this is an inefficient construction:

      . . .
      <Canvas>
        <Path Data="M80.816238403,8.903539658 L113.684082031,8.903539658 L113.684082031,15.314087868 L80.816238403,15.314087868 Z ">
          <Path.Fill>
            <SolidColorBrush Color="#FFD9D9D9" />
          </Path.Fill>
        </Path>
      </Canvas>
      <Canvas>
        <Path Data="M113.684089661,8.903539658 L258.302612305,8.903539658 L258.302612305,15.314087868 L113.684089661,15.314087868 Z ">
          <Path.Fill>
            <SolidColorBrush Color="#FFCCCCFF" />
          </Path.Fill>
        </Path>
      </Canvas>
      . . .

The aspose <FixedPage> uses <Canvas> like this nearly 4000 times - the Excel <FixedPage> uses <Canvas> about five times.

@Brian_THOMAS,

Thanks for providing us your target printer details with “<FixedPage>” contents for comparisons. We will evaluate it further and once we have an update on it, we will let you know here.