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

Free Support Forum - aspose.com

OutOfMemory when converting pdf to tif in a Windows service

Hello,

We are using the following code within a .Net 4 service running on a Windows 2003 Server, using Aspose.Pdf 7.0 :

using (Aspose.Pdf.Document pdf = new Aspose.Pdf.Document(ContentStream))
{
try
{
Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(400, 400);
Aspose.Pdf.Devices.TiffSettings tiffSettings = new Aspose.Pdf.Devices.TiffSettings();
tiffSettings.Compression = Aspose.Pdf.Devices.CompressionType.CCITT4;
Aspose.Pdf.Devices.TiffDevice tiffDevice = new Aspose.Pdf.Devices.TiffDevice(resolution, tiffSettings);
tiffDevice.Process(pdf, "tifpath.tif");
}
catch (Exception ex)
{
// ERROR
}
}


After a while, we encounter this exception :

System.OutOfMemoryException: Out of memory.
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height)
at .‹.[1]()
at Aspose.Pdf.Devices.TiffDevice.Process(Document document, Int32 fromPage, Int32 toPage, Stream output)
at Aspose.Pdf.Devices.DocumentDevice.Process(Document document, String outputFileName)


Do you have a hint about this issue ?

Regards,
AVM Informatique

Hi there,


Thanks for your inquiry. We will appreciate it if you please share your sample PDF document here, we will test the scenario and will update you accordingly.

Moreover as you are using a quite older version, please download and try latest version of Aspose.Pdf for .NET i.e 9.6.0. Hopefully it will help you to accomplish the task.

We are sorry for the inconvenience caused.

Best Regards,