When I attempt to crop, I receive an exception "The image must be color."

  • 1.1K Views
  • Last Post 11 June 2014
KSchumann posted this 09 June 2014

Some images (pdf) are scanned images in black and white (shades of gray) while others are scanned in color. But as many of my documents could be faxed to me, Even if I scan in color a black and white document... I receive an exception "The image must be color.", how can I open the document in FREngine so that it will be a color document, I have seen no clear example showing how to auto crop a document.

All of my documents are one page files...

Order By: Standard | Newest | Votes
SDK_support posted this 10 June 2014

IImageDocument::Crop method can be used for color images only. Can you please provide the description of your issue and some samples of the processed images to dev_support@abbyyusa.com.

KSchumann posted this 10 June 2014

While I can open some of the Color pdf, attached is a pdf that needs to be cropped, and I do not know of how I can open it with Color for cropping, as it is only a Black and White image (gray scale). I hoped that the rasterizer would open the color image RGB but only use the 256 gray shades with the RGB color set.

FREngine.FRDocument frDocument = engine.Engine.CreateFRDocument(); frDocument.AddImageFile(imagePath, _prepareImageMode, null); FREngine.IFRPage frPage = frDocument.Pages[0]; //Throws an Exception.... Crop MUST be color... frPage.ImageDocument.CropImage();

KSchumann posted this 10 June 2014

P.S. I don't see how I can provide samples if my problem...

SDK_support posted this 11 June 2014

At the moment the Crop method works only for color images. It is not supported for black and white or gray scale images. If it is possible, please scan the images in color. In case your issues is in something else, can you please send its description to this e-mail dev_support@abbyyusa.com

Close