When converting large (ie 25 pages or more etc) PDF files, memory usage on the server explodes and we get an out of memory error. For example, when running the conversion process in a web application, the IIS worker process will start with a memory usage of 78,364K, and when converting a large PDF file with 25 pages, the memory usage expands to 799,228K which seems extreme. On our production server, we will get a 'out of memory exception' when this happens.
The VB.NET code we are using looks as follows:
Dim document As New Aspose.Pdf.Document(pdfSourcefilePath)
'create Resolution object
Dim resolution As New Aspose.Pdf.Devices.Resolution(300)
'create TiffSettings object
Dim tiffSettings As New Aspose.Pdf.Devices.TiffSettings()
tiffSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Format1bpp
tiffSettings.Compression = Aspose.Pdf.Devices.CompressionType.CCITT4
tiffSettings.Shape = Devices.ShapeType.Portait
tiffSettings.SkipBlankPages = False
'create TIFF device
<br><br>Dim tiffDevice As New Aspose.Pdf.Devices.TiffDevice(resolution, tiffSettings)
<br>'convert a particular page and save the image to stream
<br><br>tiffDevice.Process(document, destinationFolder & "\" & fileName)
<br><br></p>