PPT to PDF Conversion Failure

Hi,

I am evaluating Aspose for the purpose of converting PPT and PPTX files to PDF. I wrote a small program to convert presentations using the Presentation.SaveToPdf() method with Aspose.Slides 3.1.1.1. Unfortunately I encountered the following exception with the first non-trivial PPT file I tried to convert:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at System.Collections.Specialized.StringCollection.get_Item(Int32 index)
at ?.?()
at Aspose.Slides.Presentation.SaveToPdf(Stream stream, Int32[] slides)
at Aspose.Slides.Presentation.SaveToPdf(Stream stream)
at Aspose.Slides.Presentation.SaveToPdf(String fname)
The problematic file is attached. Conversion did work OK for a different very simple presentation. A couple of questions:

1) Can you take a look at the attached file and see what the problem is?

2) In general, how often do these sorts of conversion problems occur? For example, is Aspose.Slides tested against a huge database of real-world PPT files and, if so, what percentage of these files can be successfully converted to PDF?

Thanks,
Daniel

Hello Daniel,

1. Presentation contains hyperlinks to non-existing slides and as a result exception is thrown. We added workaround for such cases. Please check attached new version of Aspose.Slides for .NET.

2. PDF conversion is safe enough. Most of the problems usually happen with large presentations which have many images inside. Export such presentations to PDF required a lot of memory. Anyway, we are always working on optimizations.

Hi Alexey,

1) Works great now. Thanks for the quick response!

2) I just read another thread about the memory issue and requiring 700MB of memory for that particular PPT. I have worked with low-level PDF generation libraries in the past, and did not encounter these sorts of issues - images were loaded/freed as necessary, data was streamed to/from disk as necessary, and it was possible to create PDFs of nearly unlimited size with fairly low memory usage. Are there plans to support large PPT/PDF files in Aspose.Slides by not storing everything in memory?

Regards,
Daniel

Hello Daniel,

Yes, we have memory optimizations in our plans and we are working on it but I’m afraid using temporary files is wrong way for server side components which should work for example in multithread applications or may be in asp.net with non-full trust levels.

Hi Alexey,

Glad to hear you are working on it. Just some comments about temporary files:

I have worked on multi-threaded server-side apps for many years and have never encountered a problem with creating temporary files. On the other hand, having a single thread use 700MB memory would be a big problem, and would likely kill the server with an out-of-memory error sooner or later.

If libraries have to create temporary files, they would generally name them something like {UserTempDir}\Aspose{ProcessID}-{ThreadID}.dat in order to avoid collisions in multi-process / multi-threaded scenarios. I’m not familiar with limited ASP.NET user accounts, but in general all Windows user accounts, including restricted ones, have their own user-specific temp directory that they may write files to.

Anyway, hope you find a good solution for this problem.

Regards,
Daniel