ImageMagick.MagickDelegateErrorException
Posted: 2017-06-09T00:48:56-07:00
Hi Team,
I am getting the following error - "An exception of type 'ImageMagick.MagickDelegateErrorException' occurred in Magick.NET-Q16-AnyCPU.dll but was not handled in user code Additional information: PDFDelegateFailed `The system cannot find the file specified. ' @ error/pdf.c/ReadPDFImage/793"
What I am trying to do:
1)Upload a pdf file hadrly of size 1 MB
2)Loop through each and every page of the PDF file and convert each page to a bitmap image
3)Then input the Bitmap image to the Tesseract for doing OCR
My piece of code:
-------------------
public void SplitFile(string filePath)
{
ImageMagick.MagickReadSettings settings = new ImageMagick.MagickReadSettings();
settings.Density = new ImageMagick.Density(300, 300);
ImageMagick.MagickImageCollection images = new ImageMagick.MagickImageCollection();
images.Read(filePath, settings); // IN THIS lINE I AM GETTING THE ABOVE ERROR
for (int pageNumber = 0; i <= images.Count; i++)
{
bitmap = images[pageNumber].ToBitmap();
BitmapToPixConverter b = new BitmapToPixConverter();
Pix pix = b.Convert(bitmap);
ProcessOCR(pix, pageNumber);
}
}
Looking forward for some inputs on how to get rid of the above mention error.
Installed the following package from Nuget package manger - Imagick.NET-Q16-AnyCPU
Version - 7.0.5.900
.Net framework - 4.5
Thanks in Advance,
Hari
I am getting the following error - "An exception of type 'ImageMagick.MagickDelegateErrorException' occurred in Magick.NET-Q16-AnyCPU.dll but was not handled in user code Additional information: PDFDelegateFailed `The system cannot find the file specified. ' @ error/pdf.c/ReadPDFImage/793"
What I am trying to do:
1)Upload a pdf file hadrly of size 1 MB
2)Loop through each and every page of the PDF file and convert each page to a bitmap image
3)Then input the Bitmap image to the Tesseract for doing OCR
My piece of code:
-------------------
public void SplitFile(string filePath)
{
ImageMagick.MagickReadSettings settings = new ImageMagick.MagickReadSettings();
settings.Density = new ImageMagick.Density(300, 300);
ImageMagick.MagickImageCollection images = new ImageMagick.MagickImageCollection();
images.Read(filePath, settings); // IN THIS lINE I AM GETTING THE ABOVE ERROR
for (int pageNumber = 0; i <= images.Count; i++)
{
bitmap = images[pageNumber].ToBitmap();
BitmapToPixConverter b = new BitmapToPixConverter();
Pix pix = b.Convert(bitmap);
ProcessOCR(pix, pageNumber);
}
}
Looking forward for some inputs on how to get rid of the above mention error.
Installed the following package from Nuget package manger - Imagick.NET-Q16-AnyCPU
Version - 7.0.5.900
.Net framework - 4.5
Thanks in Advance,
Hari