We convert a PDF to Tiff pages. We do this with the following code:
var resolution = new Resolution(300);
var tiffSettings = new TiffSettings
{
Compression = CompressionType.LZW,
Depth = ColorDepth.Default,
};
var tiffDevice = new TiffDevice(resolution, tiffSettings);
var pageCount = pdfDocument.Pages.Count;
string imgFormat = "000";
if (pageCount > 1000)
{
imgFormat = "0000";
}
for (var i = 1; i <= pageCount; i++)
{
var mediaBox = pdfDocument.Pages[i].MediaBox;
tiffSettings.Shape = mediaBox.Width > mediaBox.Height ? ShapeType.Landscape : ShapeType.Portrait;
tiffDevice.Process(pdfDocument, i, i, Path.ChangeExtension(pdfName, i.ToString(imgFormat) + “.tif”));
}
Is there a way to reduce the CPU usage?