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

Free Support Forum - aspose.com

oPresentation.Save(IOStream- Export.SaveFormat.Pdf) Performance Slow

Hi,

I'm encountering a performance problem with the Presentation.Save method on a Windows 2008 R2 server (64-bit). We are using ASPOSE 4.4.3 on one server running 32-bit OS and the Save method is performing exquisitely. When we moved onto a new server, what was taking 1 - 2 seconds is now taking 5-9 minutes to complete.

Our code is using the following commands:

HttpContext.Current.Response.BufferOutput = False

HttpContext.Current.Response.ContentType = "application/pdf"

HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" & Replace(LCase(FileName), ".ppt", ".pdf"))

HttpContext.Current.Response.Flush()

oPresentation.Save(IOStream, Export.SaveFormat.Pdf)

Does anyone know what might be causing the performance degradation and what I could do to fix it? Would upgrading ASPOSE to v5.5.0 solve this problem?

Thanks for your help and suggestions.

Steve

Hi Steve,

Thanks for your interest in Aspose.Slides.

Please use the latest version of Aspose.Slides for .NET 5.5.0 and let me know if you face timing issue with latest version. It would be great, If you can share your presentation file for investigation purposes. Please share .NET framework version as well.

Ok. I've downloaded and tested with v5.5.0 (both 32-bit and 64-bit) assembly versions and neither one helped with the performance improvement. I'm attaching the .pdf file that is getting created by the .Save( ) with the hope that you can help identify what might be wrong, if anything, with the .pdf file.

Might there be an IIS setting that could affect the performance?

Hi Steve,

The PresentationEx takes time to load at IIS and an issue with ID SLIDESNET-30813 already
exists in our issue tracking system to resolve this issue. This thread has also been linked
with the same issue, so that you may be automatically notified, once the
issue is resolved.


We apologize for your inconvenience.

Hi,

Thanks for the update. Is there any workaround at this time?

Regards,
Steve

Hi Steve,

I regret to share with you that there is no workaround for this issue. However, our team will work on this issue and you will be updated via this forum thread once this issue is resolved.

Is there any kind of 'Estimated Time of Fix' for ID SLIDESNET-30813 ? Can you provide a link to 'monitor' the Fix status?

Thanks,

Steve

Hi Steve,

Your issue related to following two issues.

1) The PresentationEx takes time to load at IIS (Iusse ID
SLIDESNET-30813)
2) PDF generation take immense amount of system resources and time (
Issue ID SLIDESNET-24180)

I have also linked your issue to SLIDESNET-24180 and asked for the ETA of both issue from our development team. As soon as, any information is shared by them, I will be more then happy to share that with you.

We apologize for your inconvenience and appreciate you patience.

Tahir,

Thanks for the reply. This issue is completely preventing us from opening PDFs via our website on our 64-bit Web Server. If it would help expedite the troubleshooting, I would be happy to apply a 'debug' version of aspose.dll onto our server to reproduce the problem for your team.

FYI: the .NET tracing indicates that the .Save( ) method for IOStream is throwing a Thread Aborted exception (I'm guessing it's timing out).

Cheers,

Steve

Hi Steve,

It would be great, If you can share your presentation file for investigation purposes. It would be helpful, If you can check your scenario with Visual Studio debug web server and share your findings with us.

I'm attaching two files for your review. The GOOD_Ebit.pdf is the desired PDF file output that we're expecting and was created on a Windows Server 2003 (32-bit) environment and works fine. the BAD_Ebit.pdf is supposed to the same content as the Good_Ebit.pdf but it was created on a Windows Server 2008 R2 environment using the identical program coding as the Good_Ebit file.

I'm not sure I'll be able to get the Visual Studio debug web server against our Production server but I'll see what I can do.

Incidentally, do you think this issue might be related to the following IIS link:

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> http://forums.iis.net/t/1161071.aspx

Our production server does have SP1 installed which is supposed to include the HotFix that was created for the issue in the thread.

Thanks for the help.

Steve

Hi Steve,

Thanks for sharing the information. Please share your presentation file for investigation purposes as well.

We are generating the Powerpoint slide presentation in memory and then use the IOSTREAM save using the .PDF save format directly. One note I should add, though, is when we save the presentation out as .PPT, there is no problem on the 64-bit environment - that works fine. I'm attaching the two .PPT files for your review.

The GOOD_Ebit.ppt was created on our 32-bit test server. The 64-bit_Ebit.ppt was obviously created on the 64-bit server which fails when trying to save it as the .PDF.

If these aren't the files you're requesting, then please be more specific as to what you need.

Thanks,

Steve

Hi Steve,

Thanks for sharing the presentation files. I have tested the scenario
and I am able to reproduce the same problem. For the sake of correction,
I have logged this issue as SLIDESNET-31273 in our issue tracking system. Our
team will look into this issue and you will be updated via this forum
thread once it is resolved.

The workaround for your scenario is, Please use Aspose.Slides DLL of 3.5 framework at Windows Server 2008 R2 (64 bit). Let me know, If you still face any issue.

We apologize for your inconvenience.

Hi Tahir,

I tried using the DLLs of the 3.5 framework on our Windows Server 2008 R2 (64-bit) environment but still had the same problem. (I tried the attached ZIP you provided in an earlier post as well downloading the latest 5.6.0 zip file and grabbing the 3.5 framework DLLs from there.)

If it will help any, here is a code snippet for how we are processing the slides when we go to save the powerpoint vs. PDF output.

Thanks,

Steve

------------------------------

HttpContext.Current.Response.BufferOutput = False

Dim IOStream As IO.Stream = HttpContext.Current.Response.OutputStream

If PresentationOutput = EnumPresentationOutput.PPT Then

HttpContext.Current.Response.ContentType = "application/vnd.ms-powerpoint"

HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" & FileName)

HttpContext.Current.Response.Flush()

oPresentation.Save(IOStream, Export.SaveFormat.Ppt)

Else

HttpContext.Current.Response.ContentType = "application/pdf"

HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" & Replace(LCase(FileName), ".ppt", ".pdf"))

HttpContext.Current.Response.Flush()

oPresentation.Save(IOStream, Export.SaveFormat.Pdf)

End If

If HttpContext.Current.Session.Item("PageExportStatus") Is Nothing Then

HttpContext.Current.Session.Add("PageExportStatus", cFILE_AVAILABLE)

Else

HttpContext.Current.Session.Item("PageExportStatus") = cFILE_AVAILABLE

End If

HttpContext.Current.Response.End()

Hi Steve,

Please create a simple web page with following code snippet and share your finding with me. Please share your corrupted pdf file with me which is exported with DLL framework 3.5. Please find the generated PDF file at my end in attachment.

HttpContext.Current.Response.BufferOutput = False

Dim IOStream As IO.Stream = HttpContext.Current.Response.OutputStream
Dim oPresentation As Presentation = New Presentation(“C:\Aspose.Slides\pptx\64-bit_EBIT.ppt”)

HttpContext.Current.Response.ContentType = "application/pdf"

HttpContext.Current.Response.AppendHeader(“Content-Disposition”, “attachment; filename=AsposeOut.pdf”)

HttpContext.Current.Response.Flush()

oPresentation.Save(IOStream, Aspose.Slides.Export.SaveFormat.Pdf)

Hi Tahir,

I created the simple web page with the code snippet and it did create the .PDF file correctly using the DLL for Framework 3.5. The one difference between the code snippet and our current code is that we're not physically saving the presentation out to a .PPT file first and then doing a conversion to PDF. We're working with the presentation as an IOStream directly and channeling that into the Save with PDF format.

Even though the output was successfully created, I'm still attaching the .PDF file for your review.

Thanks,

Steve

Hi Steve,

As per your recent reply, It seems that your problem is solved now with DLL 3.5 framework. You can use PresentationEx as follow:

Dim oPresentation As Presentation = New Presentation(IOStream)

If you are still facing problem, please share your flow about IOStream.

Hi Tahir,

Thanks for your help. I must have made a mistake earlier when testing the DLL 3.5 framework with our application because I just retested after modifying our .NET application to include additional logic and rebuilt it against the v3.5 DLL and we're now successfully creating the .PDF file on our production server running Windows Server 2008 R2.

Just out of curiousity, what is so different between your v3.5 DLL and the v2.0 (64-bit) DLL that the v2.0 (64-bit) was causing the problem?

Cheers,

Steve

Hi Steve,

There is no difference in DLL files functionality wise, only difference is .net framework. It is good news that your problem is solved now with .net 3.5 DLL. However, our team will look into the logged issue and you will be updated via this forum thread, once this issue is resolved.