Hi,
While converting pdf to tiff some times we are getting this error. But if We try once again it convert the file. We are working in a batch process and it’s really a problem why some files are getting failed due to memory. we are using below code:
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(fileDetail.FileInfo.FullName);
Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(300);
// Create TiffSettings object
Aspose.Pdf.Devices.TiffSettings tiffSettings = new Aspose.Pdf.Devices.TiffSettings();
tiffSettings.Compression = Aspose.Pdf.Devices.CompressionType.LZW;
tiffSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Format8bpp;
//tiffSettings.Shape = ShapeType.Landscape;
//tiffSettings.SkipBlankPages = false;
Aspose.Pdf.Devices.TiffDevice tiffDevice = new Aspose.Pdf.Devices.TiffDevice(resolution, tiffSettings);
tiffDevice.Process(pdfDocument, fileDetail.OutputPath);
below is the error which we are facing. Due to privacy we can’t share the pdf.
System.OutOfMemoryException: Exception of type ‘System.OutOfMemoryException’ was thrown.
at #=zfzvLKm0wRT16Jh9TOuuGd07SUnpq6axLW4b_ot7S3vS5GowAbw==.Get8BppImage(Bitmap #=z3SUUUUi6zRv4)
at #=zfzvLKm0wRT16Jh9TOuuGd07SUnpq6axLW4b_ot7S3vS5GowAbw==.#=ziTQ$XuWhUeF3(Bitmap #=zYrK1SF4=, PixelFormat #=zFmwdgqo=)
at #=zfzvLKm0wRT16Jh9TOuuGd07SUnpq6axLW4b_ot7S3vS5GowAbw==.#=z6gcVYww2iG5b(Bitmap #=zYrK1SF4=, Int32 #=z4HQduvg=, Int32 #=zzRuaWkQ=)
at #=zfzvLKm0wRT16Jh9TOuuGd07SUnpq6axLW4b_ot7S3vS5GowAbw==.#=zVMFoKoE=(Bitmap #=zJ_zzFf4=)
at Aspose.Pdf.Devices.TiffDevice.Process(Document document, Int32 fromPage, Int32 toPage, Stream output)
at Aspose.Pdf.Devices.DocumentDevice.Process(Document document, Stream output)
at Aspose.Pdf.Devices.DocumentDevice.Process(Document document, String outputFileName)
I wana know the reason and why its working in next attempt and how we can solve this.