How to save the input document in image format (JPG, PNG, TIFF, etc.)

Question

How to save the input document in image format (JPG, PNG, TIFF, etc.)?

Answer

Each page of a FRDocument object consists of several image planes (black-and-whitegraycolor, or preview) that can be written in an external image using the WriteToFile method of the Image object.

// C#
// Initializing FRDocument
FRDocument document = engineLoader.Engine.CreateFRDocument();

// Importing document
document.AddImageFile(inputImagePath);

FRPage page = document.Pages[0];
ImageDocument imageDocument = page.ImageDocument;
IImage bwImage = imageDocument.BlackWhiteImage;

bwImage
.WriteToFile(outputImagePath + "bwImage.bmp", ImageFileFormatEnum.IFF_BmpBwUncompressed);

 

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.