Hello, I am using Aspose.PDF to convert and save pages of a PDF file to TIFF format. On the example of the attached file PdfSample.pdf (1.5 MB), saving one page takes from 10 to 40 seconds - this is the time during which the tiffDevice.Process () command is executed. In general, the entire document with 22 pages takes 5-10 minutes - this is very long.
How can I speed up the conversion and saving of the page image? Aspose version: 21.1. Language - C#
public static void ToTiff(string input, string output)
{
Aspose.Pdf.License license = new Aspose.Pdf.License();
// Set license
license.SetLicense(AsposeLicense);
// Open document
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(input);
// Create Resolution object
Resolution resolution = new Resolution(300);
// Create TiffSettings object
TiffSettings tiffSettings = new TiffSettings();
tiffSettings.Compression = CompressionType.CCITT4;
tiffSettings.Depth = ColorDepth.Default;
tiffSettings.Shape = ShapeType.Portrait;
tiffSettings.SkipBlankPages = false;
// Create TIFF device
TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);
// Convert a particular page and save the image to stream
for (int i = 1; i <= pdfDocument.Pages.Count(); i++)
{
var savePath = $"{outputFileName}_{i}" + ".tif";
tiffDevice.Process(pdfDocument, i, i, savePath);
}
}