Yes,
Convert to Image TimeTaken = 5263
I am processing the PDF, with the following code, setting the UseOpenCL to false did not help, the processing time is still around 5 seconds
MagickNET.SetGhostscriptDirectory(ghostScriptLocation);
Convert to Image TimeTaken = 5263
I am processing the PDF, with the following code, setting the UseOpenCL to false did not help, the processing time is still around 5 seconds
MagickNET.SetGhostscriptDirectory(ghostScriptLocation);
MagickNET.UseOpenCL = false;
int width = Convert.ToInt32(displayWidth);
int height = Convert.ToInt32(displayHeight);
var settings = new MagickReadSettings { Density = new PointD(defaultDpi) };
using (var images = new MagickImageCollection())
{
//// Add all the pages of the pdf file to the collection
images.Read(pdfDocumentInBytes, settings);
////int page = 1;
Parallel.For(
0,
images.Count,
delegate(int index)
{
// ReSharper disable AccessToDisposedClosure
using (MagickImage pdfConvertedImage = images[index])
{
// ReSharper restore AccessToDisposedClosure
//// set the format of the image
pdfConvertedImage.Format = MagickFormat.Png;
pdfConvertedImage.Resize(new MagickGeometry(width, height));
var keyValuePair = new KeyValuePair<string, string>(
string.Format(imageFolderPath + FilePng, index),
pdfConvertedImage.ToBase64());
var imageHashKeyValuePair = new KeyValuePair<string, string>(
index.ToString(CultureInfo.InvariantCulture),
pdfConvertedImage.Signature);
imageCollection.Add(keyValuePair);
imageCollection.Add(imageHashKeyValuePair);
}
});
}