Class OcrInput
Stores OCR input data and allows OCR of PDF documents or any image format.
Also provides various image filter methods which can improve OCR accuracy.
Inherited Members
Namespace: IronOcr
Assembly: IronOcr.dll
Syntax
public class OcrInput : OcrInputBase, IOcrInput, IDisposable
Remarks
Also see OcrPdfInput and OcrImageInput
Constructors
OcrInput(AnyBitmap)
Create a new OcrInput object populated with a IronSoftware.Drawing.AnyBitmap.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(AnyBitmap Bitmap)
Parameters
Type | Name | Description |
---|---|---|
IronSoftware.Drawing.AnyBitmap | Bitmap | A IronSoftware.Drawing.AnyBitmap. |
OcrInput(AnyBitmap, CropRectangle)
Create a new OcrInput object populated with a IronSoftware.Drawing.AnyBitmap.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(AnyBitmap Bitmap, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
IronSoftware.Drawing.AnyBitmap | Bitmap | A IronSoftware.Drawing.AnyBitmap. |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
OcrInput(CropRectangle, Object[])
Create a new OcrInput object populated with one or more images sharing a common crop area.
This class is IDisposable and is best initiated with a 'using' statement.
This constructor accepts any number of images as File Paths, Streams, Byte Arrays, IronSoftware.Drawing.AnyBitmap, SixLabors.ImageSharp.Image, System.Drawing.Bitmap, or System.Drawing.Image. Each will become a OcrInputPage.
Declaration
public OcrInput(CropRectangle ContentArea, params object[] Inputs)
Parameters
Type | Name | Description |
---|---|---|
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Object[] | Inputs | Any number of images as File Paths, Streams, Byte Arrays, SixLabors.ImageSharp.Image, System.Drawing.Bitmap, or System.Drawing.Image. |
OcrInput(Image)
Create a new OcrInput object populated with a SixLabors.ImageSharp.Image.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(Image Image)
Parameters
Type | Name | Description |
---|---|---|
SixLabors.ImageSharp.Image | Image | SixLabors.ImageSharp.Image |
OcrInput(Image, CropRectangle)
Create a new OcrInput object populated with a specified region of a SixLabors.ImageSharp.Image.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(Image Image, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
SixLabors.ImageSharp.Image | Image | SixLabors.ImageSharp.Image |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
OcrInput(Byte[])
Create a new OcrInput object populated with an Image file as binary data.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(byte[] Bytes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | Bytes | Bytes of an Image or PDF file. |
OcrInput(Byte[], CropRectangle)
Create a new OcrInput object populated with an Image file as binary data.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(byte[] Bytes, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | Bytes | Bytes of an Image or PDF file. |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of each image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
OcrInput(IEnumerable<AnyBitmap>)
Create a new OcrInput object populated with multiple IronSoftware.Drawing.AnyBitmap.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(IEnumerable<AnyBitmap> Bitmaps)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IronSoftware.Drawing.AnyBitmap> | Bitmaps | An IEnumerable of IronSoftware.Drawing.AnyBitmap. |
OcrInput(IEnumerable<AnyBitmap>, CropRectangle)
Create a new OcrInput object populated with multiple IronSoftware.Drawing.AnyBitmap sharing a common ContentArea.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(IEnumerable<AnyBitmap> Bitmaps, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IronSoftware.Drawing.AnyBitmap> | Bitmaps | An IEnumerable of IronSoftware.Drawing.AnyBitmap. |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
OcrInput(IEnumerable<Image>)
Create a new OcrInput object populated with any number of SixLabors.ImageSharp.Image.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(IEnumerable<Image> Images)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<SixLabors.ImageSharp.Image> | Images | Any Number of SixLabors.ImageSharp.Image |
OcrInput(IEnumerable<Image>, CropRectangle)
Create a new OcrInput object populated with any number of SixLabors.ImageSharp.Image Image sharing a common ContentArea.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(IEnumerable<Image> Images, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<SixLabors.ImageSharp.Image> | Images | Any Number of SixLabors.ImageSharp.Image |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
OcrInput(IEnumerable<Byte[]>)
Create a new OcrInput object populated with the binary data of multiple Images with a common ContentArea.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(IEnumerable<byte[]> Bytes)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Byte[]> | Bytes | An IEnumerable of byte arrays containing Image or PDF files. |
OcrInput(IEnumerable<Byte[]>, CropRectangle)
Create a new OcrInput object populated with the binary data of multiple Images with a common ContentArea.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(IEnumerable<byte[]> Bytes, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Byte[]> | Bytes | An IEnumerable of byte arrays containing Image or PDF files. |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of each image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
OcrInput(IEnumerable<Stream>)
Create a new OcrInput object populated with multiple images as Streams.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(IEnumerable<Stream> Streams)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.IO.Stream> | Streams | Steam containing an Image or PDF file. |
OcrInput(IEnumerable<Stream>, CropRectangle)
Create a new OcrInput object populated with multiple images as Streams sharing a common ContentArea.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(IEnumerable<Stream> Streams, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.IO.Stream> | Streams | Steam containing an Image or PDF file. |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
OcrInput(IEnumerable<String>)
Create a new OcrInput object populated with multiple Image files.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(IEnumerable<string> FilePaths)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | FilePaths | An IEnumerable of paths to Image or PDF files. |
OcrInput(IEnumerable<String>, CropRectangle)
Create a new OcrInput object populated with multiple Image files with a common ContentArea.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(IEnumerable<string> FilePaths, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | FilePaths | An IEnumerable of paths to Image or PDF files. |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of each image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
OcrInput(Stream)
Create a new OcrInput object populated with image data as a Stream.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(Stream Stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | Stream | Steam containing an Image or PDF file. |
OcrInput(Stream, CropRectangle)
Create a new OcrInput object populated with image data as a Stream.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(Stream Stream, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | Stream | Steam containing an Image or PDF file. |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
OcrInput(Object[])
Create a new OcrInput object to which images and PDF pages may be added.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(params object[] Inputs)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | Inputs | Any number of images as File Paths, Streams, Byte Arrays, IronSoftware.Drawing.AnyBitmap and SixLabors.ImageSharp.Image. |
OcrInput(String)
Create a new OcrInput object populated with an Image file or PDF document.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(string FilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | FilePath | Path to an Image or PDF file. |
OcrInput(String, CropRectangle, Nullable<Int32>, Boolean)
Create a new OcrInput object populated with an Image file.
This class is IDisposable and is best initiated with a 'using' statement.
Declaration
public OcrInput(string FilePath, CropRectangle ContentArea, Nullable<int> DPI = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | FilePath | Path to an Image or PDF file. |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Optional target DPI for the input content |
System.Boolean | OnlyImages | When a PDF document is specified, only OCR images within the PDF document |
Methods
Add(OcrInput, CropRectangle)
Adds all pages of an OcrInput to this OcrInput.
Declaration
public void Add(OcrInput imageAsOcrInput, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
OcrInput | imageAsOcrInput | OcrInput object to be added to this OcrInput. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area to use of each page of the OcrInput object. |
Add(OcrInputPage, CropRectangle)
Adds a OcrInput OcrInputPage to this OcrInput.
Declaration
public void Add(OcrInputPage imageAsOcrInputPage, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
OcrInputPage | imageAsOcrInputPage | Page to be added. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area of the page to be added. |
Add(AnyBitmap, CropRectangle)
Adds a IronSoftware.Drawing.AnyBitmap to this OcrInput.
Declaration
public void Add(AnyBitmap imageAsBitmap, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
IronSoftware.Drawing.AnyBitmap | imageAsBitmap | A managed IronSoftware.Drawing.AnyBitmap object. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area of the image to use with IronOCR. |
Add(Byte[], CropRectangle)
Adds a byte array containing the binary data of an image to this OcrInput.
Declaration
public void Add(byte[] imageAsByteArray, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | imageAsByteArray | A byte[] containing an image. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area of the image to use with IronOCR. |
Add(IEnumerable<OcrInputPage>, CropRectangle)
Adds a IEnumerable of OcrInput OcrInputPage to this OcrInput.
Declaration
public void Add(IEnumerable<OcrInputPage> imagesAsOcrInputPages, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<OcrInputPage> | imagesAsOcrInputPages | Pages to be added. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area of every page to be added. |
Add(IEnumerable<AnyBitmap>, CropRectangle)
Adds a IEnumerable of IronSoftware.Drawing.AnyBitmap to this OcrInput.
Declaration
public void Add(IEnumerable<AnyBitmap> imageAsBitmaps, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IronSoftware.Drawing.AnyBitmap> | imageAsBitmaps | An IEnumerable of managed IronSoftware.Drawing.AnyBitmap objects. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area of the every image to use with IronOCR. |
Add(IEnumerable<Image>, CropRectangle)
Adds an IEnumerable of SixLabors.ImageSharp.Images to this OcrInput.
Declaration
public void Add(IEnumerable<Image> images, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<SixLabors.ImageSharp.Image> | images | IEnumerable of managed Image objects. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area of the every image to use with IronOCR. |
Add(IEnumerable<Byte[]>, CropRectangle)
Adds a IEnumerable of byte array containing the binary data of images to this OcrInput.
Declaration
public void Add(IEnumerable<byte[]> imagesAsByteArrays, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Byte[]> | imagesAsByteArrays | A IEnumerable of byte[] containing image data. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area of the every image to use with IronOCR. |
Add(IEnumerable<Stream>, CropRectangle)
Adds an IEnumerable of System.IO.Stream of image raw data to this OcrInput.
Declaration
public void Add(IEnumerable<Stream> sourceStreams, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.IO.Stream> | sourceStreams | A IEnumerable of Streams containing raw data of images. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area of the every image to use with IronOCR. |
Add(IEnumerable<String>, CropRectangle)
Adds images to this this OcrInput.
Declaration
public void Add(IEnumerable<string> imageFilePaths, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | imageFilePaths | IEnumerable of image file paths. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area of the every image to use with IronOCR. |
Add(Stream, CropRectangle)
Adds a System.IO.Stream containing the raw data of an image to this OcrInput.
Declaration
public void Add(Stream sourceStream, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | sourceStream | A Stream containing an image. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area of the image to use with IronOCR. |
Add(String, CropRectangle, Boolean)
Adds an image to this this OcrInput.
Declaration
public void Add(string imageFilePath, CropRectangle ContentArea = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | imageFilePath | File path to an image file. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
IronSoftware.Drawing.CropRectangle | ContentArea | Area of the image to use with IronOCR. |
System.Boolean | OnlyImages | When a PDF document is specified, only OCR images within the PDF document |
AddFrameFromTiff(Byte[], Int32, CropRectangle)
Adds a single frame (a page) from a Multi-frame TIFF file to the OcrInput document. The Tiff may be input as a file, byte array or stream.
Each Frame will become a page of this OcrInput
Declaration
public void AddFrameFromTiff(byte[] TiffBytes, int FrameIndex, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | TiffBytes | A byte[] containing a TIFF file. |
System.Int32 | FrameIndex | Zero based frame number. |
IronSoftware.Drawing.CropRectangle | ContentArea | Optionally specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
AddFrameFromTiff(Stream, Int32, CropRectangle)
Adds a single frame (a page) from a Multi-frame TIFF file to the OcrInput document. The Tiff may be input as a file, byte array or stream.
Each Frame will become a page of this OcrInput
Declaration
public void AddFrameFromTiff(Stream TiffStream, int FrameIndex, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | TiffStream | A Stream containing a TIFF file. |
System.Int32 | FrameIndex | Zero based frame number. |
IronSoftware.Drawing.CropRectangle | ContentArea | Optionally specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
AddFrameFromTiff(String, Int32, CropRectangle)
Adds a single frame (a page) from a Multi-frame TIFF file to the OcrInput document. The Tiff may be input as a file, byte array or stream.
Each Frame will become a page of this OcrInput
Declaration
public void AddFrameFromTiff(string TiffPath, int FrameIndex, CropRectangle ContentArea = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | TiffPath | A file path to a TIFF image. |
System.Int32 | FrameIndex | Zero based frame number. |
IronSoftware.Drawing.CropRectangle | ContentArea | Optionally specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
AddImage(AnyBitmap)
Adds a IronSoftware.Drawing.AnyBitmap to this OcrInput.
Declaration
public void AddImage(AnyBitmap Bitmap)
Parameters
Type | Name | Description |
---|---|---|
IronSoftware.Drawing.AnyBitmap | Bitmap | A managed IronSoftware.Drawing.AnyBitmap object. |
AddImage(AnyBitmap, CropRectangle)
Adds a IronSoftware.Drawing.AnyBitmap to this OcrInput.
Declaration
public void AddImage(AnyBitmap Bitmap, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
IronSoftware.Drawing.AnyBitmap | Bitmap | A managed IronSoftware.Drawing.AnyBitmap object. |
IronSoftware.Drawing.CropRectangle | ContentArea | Optionally specifies a region of the bitmap to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
AddImage(AnyBitmap, CropRectangle[])
Adds a IronSoftware.Drawing.AnyBitmap to this OcrInput with many content area regions. If an empty array is supplied, will use whole image instead.
Note: Output PDF of SaveAsSearchablePdf when using multiple Crop Rectangles will generate one page per Rectangle/>
Declaration
public void AddImage(AnyBitmap Bitmap, CropRectangle[] Rectangles)
Parameters
Type | Name | Description |
---|---|---|
IronSoftware.Drawing.AnyBitmap | Bitmap | A managed IronSoftware.Drawing.AnyBitmap object. |
IronSoftware.Drawing.CropRectangle[] | Rectangles | Array of crop rectangles of various content regions. |
AddImage(Image)
Adds a SixLabors.ImageSharp.Image to this OcrInput.
Declaration
public void AddImage(Image Image)
Parameters
Type | Name | Description |
---|---|---|
SixLabors.ImageSharp.Image | Image | A managed Image object. |
AddImage(Image, CropRectangle)
Adds a SixLabors.ImageSharp.Image to this OcrInput. Adds a SixLabors.ImageSharp.Image to this OcrInput.
Declaration
public void AddImage(Image Image, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
SixLabors.ImageSharp.Image | Image | A managed Image object. |
IronSoftware.Drawing.CropRectangle | ContentArea | Optionally specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
AddImage(Image, CropRectangle[])
Adds a SixLabors.ImageSharp.Image to this OcrInput with many content area regions. If an empty array is supplied, will use whole image instead.
Note: Output PDF of SaveAsSearchablePdf when using multiple Crop Rectangles will generate one page per Rectangle/>
Declaration
public void AddImage(Image Image, CropRectangle[] Rectangles)
Parameters
Type | Name | Description |
---|---|---|
SixLabors.ImageSharp.Image | Image | A managed Image object. |
IronSoftware.Drawing.CropRectangle[] | Rectangles | Array of crop rectangles of various content regions. |
AddImage(Byte[])
Adds a byte array containing the binary data of an image to this OcrInput.
Declaration
public void AddImage(byte[] ImageBytes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | ImageBytes | A byte[] containing an image. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
AddImage(Byte[], CropRectangle)
Adds a byte array containing the binary data of an image to this OcrInput.
Declaration
public void AddImage(byte[] ImageBytes, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | ImageBytes | A byte[] containing an image. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
IronSoftware.Drawing.CropRectangle | ContentArea | Optionally specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
AddImage(Stream)
Adds a System.IO.Stream containing the raw data of an image to this OcrInput.
Declaration
public void AddImage(Stream ImageStream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | ImageStream | A Stream containing an image. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
AddImage(Stream, CropRectangle)
Adds a System.IO.Stream containing the raw data of an image to this OcrInput.
Declaration
public void AddImage(Stream ImageStream, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | ImageStream | A Stream containing an image. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
IronSoftware.Drawing.CropRectangle | ContentArea | Optionally specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
AddImage(String)
Adds an image file to this OcrInput.
Declaration
public void AddImage(string ImagePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | ImagePath | File path to an image file. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
AddImage(String, CropRectangle)
Adds an image file to this OcrInput.
Declaration
public void AddImage(string ImagePath, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.String | ImagePath | File path to an image file. Supported formats include JPEG, TIFF, GIF, PNG, PDF, BMP. |
IronSoftware.Drawing.CropRectangle | ContentArea | Optionally specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
AddMultiFrameTiff(Byte[])
Adds a byte[] containing the binary data of a TIFF image with multiple pages to this OcrInput.
Declaration
public void AddMultiFrameTiff(byte[] TiffBytes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | TiffBytes | A byte[] containing a TIFF file. |
AddMultiFrameTiff(Byte[], CropRectangle)
Adds a byte[] containing the binary data of a TIFF image with multiple pages to this OcrInput.
Declaration
public void AddMultiFrameTiff(byte[] TiffBytes, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | TiffBytes | A byte[] containing a TIFF file. |
IronSoftware.Drawing.CropRectangle | ContentArea | Optionally specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
AddMultiFrameTiff(Stream)
Adds a Stream containing the binary data of a TIFF image with multiple pages to this OcrInput.
Declaration
public void AddMultiFrameTiff(Stream TiffStream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | TiffStream | A System.IO.Stream containing a TIFF file . |
AddMultiFrameTiff(Stream, CropRectangle)
Adds a Stream containing the binary data of a TIFF image with multiple pages to this OcrInput.
Declaration
public void AddMultiFrameTiff(Stream TiffStream, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | TiffStream | A System.IO.Stream containing a TIFF file . |
IronSoftware.Drawing.CropRectangle | ContentArea | Optionally specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
AddMultiFrameTiff(String)
Adds a Multi-frame TIFF file to the OcrInput document.
Each Frame will become a page of this OcrInput
Declaration
public void AddMultiFrameTiff(string ImagePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | ImagePath | A file path to a TIFF image. |
AddMultiFrameTiff(String, CropRectangle)
Adds a Multi-frame TIFF file to the OcrInput document.
Each Frame will become a page of this OcrInput
Declaration
public void AddMultiFrameTiff(string ImagePath, CropRectangle ContentArea)
Parameters
Type | Name | Description |
---|---|---|
System.String | ImagePath | A file path to a TIFF image. |
IronSoftware.Drawing.CropRectangle | ContentArea | Optionally specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
AddPdf(Byte[], String, CropRectangle, Nullable<Int32>)
Adds all pages of a PDF document to this OcrInput.
Declaration
public void AddPdf(byte[] PdfBytes, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | PdfBytes | Binary data of a PDF file |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
AddPdf(Stream, String, CropRectangle, Nullable<Int32>, Boolean)
Adds all pages of a PDF document to this OcrInput.
Declaration
public void AddPdf(Stream PdfStream, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | PdfStream | System.IO.Stream containing a PDF |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
AddPdf(String, Int32, String, Boolean)
Adds all pages of a PDF document to this OcrInput.
Declaration
public void AddPdf(string PdfPath, int DPI, string Password = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | PdfPath | String file path to the PDF |
System.Int32 | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
AddPdf(String, String, CropRectangle, Nullable<Int32>, Boolean)
Adds all pages of a PDF document to this OcrInput.
Declaration
public void AddPdf(string PdfPath, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | PdfPath | String file path to the PDF |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
AddPdfPage(Byte[], Int32, String, CropRectangle, Nullable<Int32>)
Adds one page of a PDF document to this OcrInput.
Declaration
public void AddPdfPage(byte[] PdfBytes, int Page, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | PdfBytes | Binary data of a PDF file |
System.Int32 | Page | The page number within the PDF to read. Zero based (first page is number 0) |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
AddPdfPage(Stream, Int32, String, CropRectangle, Nullable<Int32>, Boolean)
Adds one page of a PDF document to this OcrInput.
Declaration
public void AddPdfPage(Stream PdfStream, int Page, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | PdfStream | System.IO.Stream containing a PDF |
System.Int32 | Page | The page number within the PDF to read. Zero based (first page is number 0) |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
AddPdfPage(String, Int32, String, CropRectangle, Nullable<Int32>, Boolean)
Adds one page of a PDF document to this OcrInput.
Declaration
public void AddPdfPage(string PdfPath, int Page, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | PdfPath | String file path to the PDF |
System.Int32 | Page | The page number within the PDF to read. Zero based (first page is number 0) |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
AddPdfPages(Byte[], IEnumerable<Int32>, String, CropRectangle, Nullable<Int32>, Boolean)
Adds selected pages of a PDF document to this OcrInput.
Declaration
public void AddPdfPages(byte[] PdfBytes, IEnumerable<int> Pages, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | PdfBytes | Binary data of a PDF file |
System.Collections.Generic.IEnumerable<System.Int32> | Pages | The page numbers within the PDF to read. Zero based (first page is number 0) |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
AddPdfPages(Stream, IEnumerable<Int32>, String, CropRectangle, Nullable<Int32>, Boolean)
Adds selected pages of a PDF document to this OcrInput.
Declaration
public void AddPdfPages(Stream PdfStream, IEnumerable<int> Pages, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | PdfStream | System.IO.Stream containing a PDF |
System.Collections.Generic.IEnumerable<System.Int32> | Pages | The page numbers within the PDF to read. Zero based (first page is number 0) |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
AddPdfPages(String, IEnumerable<Int32>, String, CropRectangle, Nullable<Int32>, Boolean)
Adds selected pages from a PDF document into this OcrInput.
Declaration
public void AddPdfPages(string PdfPath, IEnumerable<int> Pages, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | PdfPath | String file path to the PDF |
System.Collections.Generic.IEnumerable<System.Int32> | Pages | |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
FromPdf(Byte[], String, CropRectangle, Nullable<Int32>, Boolean)
Create a new OcrInput object populated with a PDF as binary data.
This class is IDisposable and is best initiated with a 'using' statement.
This constructor accepts pdf as File Paths, Streams, or Byte Arrays. Each will become a OcrInputPage.
Declaration
public static OcrInput FromPdf(byte[] PdfBytes, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | PdfBytes | The PDF document as binary data in memory. |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
Returns
Type | Description |
---|---|
OcrInput |
FromPdf(Stream, String, CropRectangle, Nullable<Int32>, Boolean)
Create a new OcrInput object populated with a PDF as a Stream.
This class is IDisposable and is best initiated with a 'using' statement.
This constructor accepts pdf as File Paths, Streams, or Byte Arrays. Each will become a OcrInputPage.
Declaration
public static OcrInput FromPdf(Stream PdfStream, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | PdfStream | The PDF document as a System.IO.Stream. |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
Returns
Type | Description |
---|---|
OcrInput |
FromPdf(String, Int32, String, Boolean)
Create a new OcrInput object populated with a PDF.
This class is IDisposable and is best initiated with a 'using' statement.
This constructor accepts pdf as File Paths, Streams, or Byte Arrays. Each will become a OcrInputPage.
Declaration
public static OcrInput FromPdf(string PdfPath, int DPI, string Password = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | PdfPath | File path to the PDF |
System.Int32 | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
Returns
Type | Description |
---|---|
OcrInput |
FromPdf(String, String, CropRectangle, Nullable<Int32>, Boolean)
Create a new OcrInput object populated with a PDF.
This class is IDisposable and is best initiated with a 'using' statement.
This constructor accepts pdf as File Paths, Streams, or Byte Arrays. Each will become a OcrInputPage.
Declaration
public static OcrInput FromPdf(string PdfPath, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | PdfPath | File path to the PDF |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
Returns
Type | Description |
---|---|
OcrInput |
FromPdfPage(Byte[], Int32, String, CropRectangle, Nullable<Int32>, Boolean)
Create a new OcrInput object populated with a single page from a PDF as binary data.
This class is IDisposable and is best initiated with a 'using' statement.
This constructor accepts pdf as File Paths, Streams, or Byte Arrays. Each will become a OcrInputPage.
Declaration
public static OcrInput FromPdfPage(byte[] PdfBytes, int Page, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | PdfBytes | The PDF document as binary data in memory. |
System.Int32 | Page | The page number within the PDF to read. Zero based (first page is number 0) |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
Returns
Type | Description |
---|---|
OcrInput |
FromPdfPage(Stream, Int32, String, CropRectangle, Nullable<Int32>, Boolean)
Create a new OcrInput object populated with a single page from a PDF as a Stream.
This class is IDisposable and is best initiated with a 'using' statement.
This constructor accepts pdf as File Paths, Streams, or Byte Arrays. Each will become a OcrInputPage.
Declaration
public static OcrInput FromPdfPage(Stream PdfStream, int Page, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | PdfStream | The PDF document as a System.IO.Stream. |
System.Int32 | Page | The page number within the PDF to read. Zero based (first page is number 0) |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
Returns
Type | Description |
---|---|
OcrInput |
FromPdfPage(String, Int32, String, CropRectangle, Nullable<Int32>, Boolean)
Create a new OcrInput object populated with a single page of a PDF.
This class is IDisposable and is best initiated with a 'using' statement.
This constructor accepts pdf as File Paths, Streams, or Byte Arrays. Each will become a OcrInputPage.
Declaration
public static OcrInput FromPdfPage(string PdfPath, int Page, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | PdfPath | File path to the PDF |
System.Int32 | Page | Which page of the PDF to read. Zero based (first page is number 0) |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
Returns
Type | Description |
---|---|
OcrInput |
FromPdfPages(Byte[], IEnumerable<Int32>, String, CropRectangle, Nullable<Int32>, Boolean)
Create a new OcrInput object populated with multiple pages from a PDF as binary data.
This class is IDisposable and is best initiated with a 'using' statement.
This constructor accepts pdf as File Paths, Streams, or Byte Arrays. Each will become a OcrInputPage.
Declaration
public static OcrInput FromPdfPages(byte[] PdfBytes, IEnumerable<int> Pages, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | PdfBytes | The PDF document as binary data in memory. |
System.Collections.Generic.IEnumerable<System.Int32> | Pages | List which pages of the PDF which will be read. Zero based (first page is number 0) |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
Returns
Type | Description |
---|---|
OcrInput |
FromPdfPages(Stream, IEnumerable<Int32>, String, CropRectangle, Nullable<Int32>, Boolean)
Create a new OcrInput object populated with multiple selected pages from a PDF as a Stream.
This class is IDisposable and is best initiated with a 'using' statement.
This constructor accepts pdf as File Paths, Streams, or Byte Arrays. Each will become a OcrInputPage.
Declaration
public static OcrInput FromPdfPages(Stream PdfStream, IEnumerable<int> Pages, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | PdfStream | The PDF document as a System.IO.Stream. |
System.Collections.Generic.IEnumerable<System.Int32> | Pages | The pages of the PDF to read. Zero based (first page is number 0) |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
Returns
Type | Description |
---|---|
OcrInput |
FromPdfPages(String, IEnumerable<Int32>, String, CropRectangle, Nullable<Int32>, Boolean)
Create a new OcrInput object populated with multiple pages from a PDF.
This class is IDisposable and is best initiated with a 'using' statement.
This constructor accepts pdf as File Paths, Streams, or Byte Arrays. Each will become a OcrInputPage.
Declaration
public static OcrInput FromPdfPages(string PdfPath, IEnumerable<int> Pages, string Password = null, CropRectangle ContentArea = null, Nullable<int> DPI = null, bool OnlyImages = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | PdfPath | File path to the PDF |
System.Collections.Generic.IEnumerable<System.Int32> | Pages | List which pages of the PDF will be read. Zero based (first page is number 0) |
System.String | Password | Optional Password to unlock an encrypted or protected PDF |
IronSoftware.Drawing.CropRectangle | ContentArea | Specifies a region of the image to extract text from as a IronSoftware.Drawing.CropRectangle with X, Y Width and Height in pixels. Setting a ContentArea can improve OCR speed. |
System.Nullable<System.Int32> | DPI | Resolution at which to sample the PDF. If null or zero will use |
System.Boolean | OnlyImages | Only apply OCR to images within the PDF, and ignore existing text |
Returns
Type | Description |
---|---|
OcrInput |