ParserGetImages Method (PageAreaOptions) |
Namespace: GroupDocs.Parser
The following example shows how to extract only images from the upper-left courner:
// Create an instance of Parser class using (Parser parser = new Parser(filePath)) { // Create the options which are used for images extraction PageAreaOptions options = new PageAreaOptions(new Rectangle(new Point(0, 0), new Size(300, 100))); // Extract images from the upper-left courner of a page: IEnumerable<PageImageArea> images = parser.GetImages(options); // Check if images extraction is supported if (images == null) { Console.WriteLine("Page images extraction isn't supported"); return; } // Iterate over images foreach (PageImageArea image in images) { // Print a page index, rectangle and image type: Console.WriteLine(string.Format("Page: {0}, R: {1}, Type: {2}", image.Page.Index, image.Rectangle, image.FileType)); } }