The PDF To TIFF conversion in the Aspose.PDF API (v23.1.1.0) is performing the conversion in memory before writing to the output stream.
This limits the size of the documents we can convert and write to file. A PDF file with 150 pages of 10MB uses 2GB to 3GB+ Memory.
Have you tried using 23.4 version of the API? Please share your sample PDF and code snippet with us. We will test the scenario in our environment and address it accordingly.
image.png (4.2 KB)
We are using the complete name. Aspose.Pdf.XpsLoadOptions options = new Aspose.Pdf.XpsLoadOptions();
Error: The type or namespace name ‘XpsLoadOptions’ does not exist in the namespace ‘Aspose.Pdf’ (are you missing an assembly reference?)
We could not notice this issue at our end. XpsLoadOptions class is accessible. Can you please share a sample console application so that we could observe this issue and address it accordingly?
With the v23.4 we can only see 10%-20% reduction in the Memory usage compared to 23.1.
Could you please suggest other solutions or will there be any improvement in the future releases?
23.5 version is just rolled out and you can try it as well. Furthermore, we need your sample document to test it and observe memory consumption in our environment so that we can further comment on the situation and share our feedback.
We have the files that caused the issue are ready to be shared. Please let me know how I can share the files securely to you as I cannot share them here!
We used 23.7 version of the API and the following code snippet to test the scenario in our environment. We could not notice the OOM Exception. Can you please make sure that you are using the latest version? Also, please let us know about your complete environment details i.e. OS Name and Version, Application Type, RAM Size, etc.
It is also possible that the exception is being thrown due to other Aspose API that is being used. Please try to create a separate console application and test at your end using only Aspose.PDF and let us know in case you find any issues.
Aspose.Pdf.Document _document = new Aspose.Pdf.Document(dataDir + "1.pdf");
TiffSettings options = new TiffSettings();
//options.Compression = CompressionType.CCITT4;
Resolution resolutionObj = new Resolution(200);
options.Shape = ShapeType.None;
options.CoordinateType = PageCoordinateType.MediaBox;
options.Brightness = 0.5F;
TiffDevice tiffDevice = new TiffDevice(resolutionObj, options);
RenderingOptions RenderingOption = new RenderingOptions();
RenderingOption.IgnoreResourceFontErrors = true;
tiffDevice.RenderingOptions = RenderingOption;
using (FileStream imageStream = new FileStream(dataDir + DateTime.Now.Millisecond + @".tif", FileMode.Create))
{
tiffDevice.Process(_document, imageStream);
imageStream.Close();
}