Slow speed when converting a .xlsx to pdf

Posted by: renaud.roland on 3 October 2022, 4:45 pm EST

    • Post Options:
    • Link

    Posted 3 October 2022, 4:45 pm EST

    Hello, i have speed issues when converting a .xlsx into a .pdf.

    When i generate the stream from the workbook, if i save in .pdf format, it take more than 12s to get the .pdf stream when the .xlsx stream is done in less than a seconde :

    public Stream GenerateStreamFromWorkBook(Workbook workbook, FileDownloadFormat? downloadFormat)
            {
    
                var result = new MemoryStream();
                workbook.Calculate();
                if(downloadFormat == FileDownloadFormat.Pdf)
                    workbook.Save(result,SaveFileFormat.Pdf);
                else
                {
                    workbook.Save(result, SaveFileFormat.Xlsx);
                }
                result.Position = 0;
                return result;
            }

    is there any way to improve this ?

  • Posted 5 October 2022, 3:22 pm EST

    Hello Roland,

    Apologies for the inconvenience caused at your end.

    We do not face such drastic issues at our end, it might be specific to your workbook so can you please share the excel file that you are using at your end?

    If the data in the excel file is confidential, I would recommend you share it with dummy data or create a case on our private portal and share the file there only:

    https://www.grapecity.com/my-account/my-support

    Regards,

    Prabhat Sharma.

  • Posted 5 October 2022, 5:36 pm EST

    Hello, here is a sample of a .xlsx generate by GrapeCity. Let me know if it help you.

    sampleGrapeCity.zip

  • Posted 6 October 2022, 4:00 pm EST - Updated 6 October 2022, 5:31 pm EST

    Hello Roland,

    Thank you for sharing the file.

    We have tried it at our end and it is taking 3 seconds to export this file into pdf stream.

    Can you please go through the attached sample and see if you are doing anything different which is taking much longer time?

    Also, we can observe that pdf export is taking almost 3x more time than excel export so we are discussing it also with the devs to see if we can improve it.

    [Internal Tracking ID: DOCXLS-6730]

    Regards,

    Prabhat Sharma.

    .

    XLSX_TO_PDF.zip

  • Posted 10 October 2022, 1:25 am EST

    Well, sorry but i make a mistake when uploading the xlsx file, i do the test with the good file :

    Start

    Pdf: 00:00:14.4848844

    End

    Start

    Excel: 00:00:00.4284899

    End

    could you try with the new .xlsx ? (add in the project in zip : PRENOT_202210(1).xlsx)

    file.zip

  • Posted 10 October 2022, 3:45 pm EST

    Hello Roland,

    Thank you for submitting the original file.

    We too can observe the issue with your given file and escalate this to the developers for optimization, and as per the latest updates from the development team, it will be fixed in the next hotfix release 5.2.3 which will be released by the end of this week.

    Regards,

    Prabhat Sharma.

  • Posted 12 October 2022, 10:32 pm EST

    Hello Roland,

    We are glad to inform you that this issue has been fixed in the latest version of GcExcel API 5.2.3. You can upgrade to the latest version to see the changes:

    https://www.nuget.org/packages/GrapeCity.Documents.Excel/

    Regards,

    Prabhat Sharma.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels