layout | title | description | keywords | needGenerateH3Content | needAutoGenerateSidebar | noTitleIndex |
---|---|---|---|---|---|---|
default-layout |
DSFileFetcher - Dynamsoft Capture Vision Router Module iOS Edition API Reference |
The class DSFileFetcher of Dynamsoft Capture Vision Router Module is a utility class that partitions a multi-page image file into multiple independent ImageData objects. |
file fetcher, objective-c, swift |
true |
true |
true |
The DSFileFetcher
class is a utility class that partitions a multi-page image file into multiple independent ImageData
objects. It inherits from the DSImageSourceAdapter
class.
Assembly: DynamsoftUtility.framework
>- Objective-C >- Swift > >1. ```objc @interface DSFileFetcher : NSObject ``` 2. ```swift class FileFetcher : NSObject ```Method | Description |
---|---|
setFileWithPath |
Sets the file with a file path. |
setFileWithBytes |
Sets the file with file bytes. |
setFileWithBuffer |
Sets the file with a DSImageData object. |
setFileWithImage |
Sets the file with a UIImage . |
hasNextImageToFetch |
Whether there is a next image to fetch. |
getImage |
Get the image data of the image. |
setPages |
Set the pages to read. |
Sets the file with a file path.
>- Objective-C >- Swift > >1. ```objc -(BOOL)setFileWithPath:(NSString *)filePath error:(NSError *_Nullable *_Nullable)error; ``` 2. ```swift func setFile(withPath filePath: String) throws ``` **Parameters**filePath
: The file path.
error
: An NSError
pointer. If an error occurs, it will represent the error information.
Error
Error Code | Value | Description |
---|---|---|
EC_FILE_NOT_FOUND | -10005 | The file is not found. |
EC_FILE_TYPE_NOT_SUPPORTED | -10006 | The file type is not supported. |
Sets the file with file bytes.
>- Objective-C >- Swift > >1. ```objc -(BOOL)setFileWithBytes:(NSData *)fileBytes error:(NSError *_Nullable *_Nullable)error; ``` 2. ```swift func setFile(withBytes fileBytes: Data) throws ```Parameters
fileBytes
: The file bytes.
error
: An NSError
pointer. If an error occurs, it will represent the error information.
Error
Error Code | Value | Description |
---|---|---|
EC_NULL_POINTER | -10002 | The fileBytes you input is null. |
Sets the file with a DSImageData
object.
buffer
: The image data.
error
: An NSError
pointer. If an error occurs, it will represent the error information.
Error
Error Code | Value | Description |
---|---|---|
EC_NULL_POINTER | -10002 | The fileBytes you input is null. |
Sets the file with a UIImage
.
image
: A UIImage
.
error
: An NSError
pointer. If an error occurs, it will represent the error information.
Error
Error Code | Value | Description |
---|---|---|
EC_NULL_POINTER | -10002 | The fileBytes you input is null. |
Whether there is a next image to fetch.
>- Objective-C >- Swift > >1. ```objc -(BOOL)hasNextImageToFetch; ``` 2. ```swift func hasNextImageToFetch() -> Bool ```Return Value
A bool value that indicates whether there is a next image to fetch.
Get the image data of the image.
>- Objective-C >- Swift > >1. ```objc -(DSImageData *)getImage; ``` 2. ```swift func getImage() -> ImageData ```Return Value
A DSImageData
as the image.
Set the pages to read.
>- Objective-C >- Swift > >1. ```objc -(BOOL)setPages:(NSArray *)pages error:(NSError *_Nullable *_Nullable)error; ``` 2. ```swift func setPages(_ pages: NSArray) throws -> BOOL ```Parameters
pages
: An array that contains all the pages to read.
error
: An NSError
pointer. If an error occurs, it will represent the error information.
Error
Error Code | Value | Description |
---|---|---|
EC_FILE_NOT_FOUND | -10005 | File not found. |
EC_FILE_TYPE_NOT_SUPPORTED | -10006 | The file type is not supported. |
EC_IMAGE_READ_FAILED | -10012 | Failed to read the image. |