We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Cells .NET Core 2.1 saving workbook as PDF fails on Linux box

Hello,

Any idea how long it will take to resolve this issue?

@rw3,

We are gathering information for this issue and will provide our feedback soon.

Sounds good, thanks.

@rw3

We have tested the performance on both Windows and Linux.
Here is the test environment:
1, Windows7 64bit, 8GB memory. Test using VS 2017, NUnit3.9.
2, Ubuntu Linux 16.04, 64bit, work on VMware, 2GB memory. test using NUnitLite 3.10.

And, here is the test result:

1, Open the test file and save it, for only one time.
Workbook workbook = new Workbook(Constants.sourcePath + “TMP - Plan Call Page.xlsm”);
workbook.Save(Constants.destPath + “TMP - Plan Call Page.pdf”, SaveFormat.Pdf);
On Windows, it costs about 3.5 seconds.
On Linux, it costs about 7 seconds.

2, Open the test file and save it, for 5 times.
Workbook wb = new Workbook(Constants.TemplatePath + “TMP - Plan Call Page.xlsm”);
wb.Save(Constants.TemplatePath + “PlanCall_out1.pdf”, SaveFormat.Pdf);

        wb = new Workbook(Constants.TemplatePath + "TMP - Plan Call Page.xlsm");
        wb.Save(Constants.TemplatePath + "PlanCall_out2.pdf", SaveFormat.Pdf);

        wb = new Workbook(Constants.TemplatePath + "TMP - Plan Call Page.xlsm");
        wb.Save(Constants.TemplatePath + "PlanCall_out3.pdf", SaveFormat.Pdf);

        wb = new Workbook(Constants.TemplatePath + "TMP - Plan Call Page.xlsm");
        wb.Save(Constants.TemplatePath + "PlanCall_out4.pdf", SaveFormat.Pdf);

        wb = new Workbook(Constants.TemplatePath + "TMP - Plan Call Page.xlsm");
        wb.Save(Constants.TemplatePath + "PlanCall_out5.pdf", SaveFormat.Pdf);

On Windows, it costs about 4.5 seconds.
On Linux, it costs about 9 seconds.

We repeat above tests for several times, and we can confirm the time cost has been correctly recorded.

1, When we run a DLL, it will cost several seconds to do the initialization operation.
The system(Windows or Linux) call a DLL need to do initialization, and our DLL need to initialize some static parameters, and so on.
Based on the system difference, and environment difference(for example, 8GB memory windows, 2GB memory Linux on VMWare), the initialization time may be different.
That is why we open and save the test file for one time, it costs a long time (3.5 seconds on Windows, and 7 seconds on Linux).

2, Then we open and save the test file for 5 times, to see the real “file open and save time” cost.
Based on the time data recorded above, we can approximately get:
The initialization operation cost 3 seconds on Windows, 6 seconds on Linux.
The “file open and save time” is 0.3 second on Windows, 0.6 second on Linux.

So, please check the test again on your environment, run the “open and save” for more than one time, to see the real time cost.
Maybe you ignored the initialization time on Windows, then you get the conclusion: 100ms on Windows, 10 seconds on Linux.
We can see that on Linux(2GB) is slower than on Windows(8GB), for one time, but not for 1000 times.

Thanks for the update, I will check again and get back. Any thoughts on some of the charts getting lost between windows and linux issue?

@rw3,

Check suggested approach on your side and then update us about your findings. Please create separate thread for the problem of missing charts and we will investigate it accordingly.

Hello,

I tried the sample code in our linux box which has 4 GB RAM and it takes ~18 seconds. Comparing that to your stat it seems something else is going on. Is there anything else I can check on?

Here is the code I tried:

     Console.WriteLine("Creating File 1 - " + DateTime.Now.ToString("HH:mm:ss.fff"));
     Workbook wb = new Workbook(_workbookName);
     Console.WriteLine(" Before Save - " + DateTime.Now.ToString("HH:mm:ss.fff"));
     wb.Save("plancallPlanCall_out1.pdf", SaveFormat.Pdf);
     Console.WriteLine(" After  Save - " + DateTime.Now.ToString("HH:mm:ss.fff"));

     Console.WriteLine("Creating File 2 - " + DateTime.Now.ToString("HH:mm:ss.fff"));
     wb = new Workbook(_workbookName);
     Console.WriteLine(" Before Save - " + DateTime.Now.ToString("HH:mm:ss.fff"));
     wb.Save("plancallPlanCall_out2.pdf", SaveFormat.Pdf);
     Console.WriteLine(" After  Save - " + DateTime.Now.ToString("HH:mm:ss.fff"));

     Console.WriteLine("Creating File 3 - " + DateTime.Now.ToString("HH:mm:ss.fff"));
     wb = new Workbook(_workbookName);
     Console.WriteLine(" Before Save - " + DateTime.Now.ToString("HH:mm:ss.fff"));
     wb.Save("plancallPlanCall_out3.pdf", SaveFormat.Pdf);
     Console.WriteLine(" After  Save - " + DateTime.Now.ToString("HH:mm:ss.fff"));

     Console.WriteLine("Creating File 4 - " + DateTime.Now.ToString("HH:mm:ss.fff"));
     wb = new Workbook(_workbookName);
     Console.WriteLine(" Before Save - " + DateTime.Now.ToString("HH:mm:ss.fff"));
     wb.Save("plancallPlanCall_out4.pdf", SaveFormat.Pdf);
     Console.WriteLine(" After  Save - " + DateTime.Now.ToString("HH:mm:ss.fff"));

     Console.WriteLine("Creating File 5 - " + DateTime.Now.ToString("HH:mm:ss.fff"));
     wb = new Workbook(_workbookName);
     Console.WriteLine(" Before Save - " + DateTime.Now.ToString("HH:mm:ss.fff"));
     wb.Save("plancallPlanCall_out5.pdf", SaveFormat.Pdf);
     Console.WriteLine(" After  Save - " + DateTime.Now.ToString("HH:mm:ss.fff"));

Here is the output:

  Creating File 1 - 11:08:21.685
   Before Save - 11:08:24.174
   After  Save - 11:08:29.176
  Creating File 2 - 11:08:29.177
   Before Save - 11:08:29.204
   After  Save - 11:08:31.774
  Creating File 3 - 11:08:31.774
   Before Save - 11:08:31.802
   After  Save - 11:08:34.365
  Creating File 4 - 11:08:34.366
   Before Save - 11:08:34.395
   After  Save - 11:08:36.965
  Creating File 5 - 11:08:36.965
   Before Save - 11:08:36.992
   After  Save - 11:08:39.584

You can see if took ~18 seconds, save operation is most time consuming.

@rw3,

We have investigated your issue further and below are our findings:

After downloading “TMP - Plan Call Page.zip”, it contains 3 files:

  1. TMP - Plan Call Page.xlsm
  2. PC 488214 - Linux.pdf
  3. PC 488214 - Windows.pdf

Then, I tested following codes, on both Windows7 and Ubuntu:

        Workbook workbook = new Workbook(Constants.sourcePath + "TMP - Plan Call Page.xlsm");
        workbook.Save(Constants.destPath + "TMP - Plan Call Page.pdf", SaveFormat.Pdf);

On both Windows7 and Ubuntu, I get the same results:
There are 4 charts in “TMP - Plan Call Page.xlsm” and I can get all the 4 charts in “TMP - Plan Call Page.pdf”.

But I notice that in “TMP - Plan Call Page.zip”:
PC 488214 - Linux.pdf
PC 488214 - Windows.pdf
There are more than 4 charts in them, although they have different chats in them,
but I can not locate the problem based on “TMP - Plan Call Page.xlsm” you provided.

So, would you please check the “TMP - Plan Call Page.xlsm” you have already provided,
Is “PC 488214 - Linux.pdf” and “PC 488214 - Windows.pdf” created by “TMP - Plan Call Page.xlsm”?

Please also provide a “PC 488214.xlsm”, which contains more charts so that we can investigate further and then reply you with all details.

@rw3,

We have investigated it based on the feedback recently shared by you. The "TMP - Plan Call Page.xlsm " we have tested is 39KB, contains 4 charts. And the PDF files we have created is 46KB. But the “PC 488214 - Linux.pdf” and “PC 488214 - Windows.pdf” in “PlanCall.zip”, is 166KB, contains much more than 4 charts. I think may be you should check the "TMP - Plan Call Page.xlsm " you provided? If the test file is larger, it will cost more time.

I will send you sample files for chart missing issue. For the slowness issue, I did tested with same template and no data, still it took on average 18 seconds. I am attaching the PDFs created. PlanCall_Outputs.zip (192.1 KB)

@rw3,

Thank you for the feedback. We have logged this information for analysis later and we will provide our feedback when ready. For slowness issue, as suggested earlier, please create a separate thread along with the detailed information and supporting files.

I think you got backwards, I will create a separate ticket for the chart missing issue and we can continue to discuss on the slowness issue in this one.

btw, created separate ticket for chart loss issue:

@rw3,

Yes you are right, separate thread is to be created for the missing charts issue as mentioned here.

Hello,

Any update on this?

@rw3,

Currently there is no significant update at the moment. We will let you know as soon as some progress will be made in this regard.

Sounds good, thank you.

Hello, Any update on this issue?

@rw3,

This issue is not resolved yet due to its complexity. I am afraid that ETA cannot be provided right now however you will be informed immediately once any feedback is ready to provide.

ok, thank you