Resource Base
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

DSFileFetcher

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.

Definition

Assembly: DynamsoftUtility.framework

  • Objective-C
  • Swift
  1. @interface DSFileFetcher : NSObject
    
  2. class FileFetcher : NSObject
    

Methods

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.

setFileWithPath

Sets the file with a file path.

  • Objective-C
  • Swift
  1. -(BOOL)setFileWithPath:(NSString *)filePath
                 error:(NSError *_Nullable *_Nullable)error;
    
  2. 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.

setFileWithBytes

Sets the file with file bytes.

  • Objective-C
  • Swift
  1. -(BOOL)setFileWithBytes:(NSData *)fileBytes
                  error:(NSError *_Nullable *_Nullable)error;
    
  2. 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.

setFileWithBuffer

Sets the file with a DSImageData object.

  • Objective-C
  • Swift
  1. -(BOOL)setFileWithBuffer:(DSImageData *)buffer
                   error:(NSError *_Nullable *_Nullable)error;
    
  2. func setFile(withBuffer buffer: ImageData) throws
    

    Parameters

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.

setFileWithImage

Sets the file with a UIImage.

  • Objective-C
  • Swift
  1. -(BOOL)setFileWithImage:(UIImage *)image
                  error:(NSError *_Nullable *_Nullable)error;
    
  2. func setFile(withImage image: UIImage) throws
    

    Parameters

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.

hasNextImageToFetch

Whether there is a next image to fetch.

  • Objective-C
  • Swift
  1. -(BOOL)hasNextImageToFetch;
    
  2. func hasNextImageToFetch() -> Bool
    

Return Value

A bool value that indicates whether there is a next image to fetch.

getImage

Get the image data of the image.

  • Objective-C
  • Swift
  1. -(DSImageData *)getImage;
    
  2. func getImage() -> ImageData
    

Return Value

A DSImageData as the image.

setPages

Set the pages to read.

  • Objective-C
  • Swift
  1. -(BOOL)setPages:(NSArray *)pages
          error:(NSError *_Nullable *_Nullable)error;
    
  2. 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.

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 2.x
    • Version 2.2.10
    • Version 2.0.21
    • Version 2.0.20
    • Version 2.0.10
    • Version 2.2.10
    • Version 2.0.21
    • Version 2.0.20
    • Version 2.0.10
  • Version 1.x
    • Version 1.2.1
    • Version 1.2.0
    • Version 1.1.0
    • Version 1.0.0
    • Version 1.0.4
    • Version 1.0.3
    • Version 1.0.2
    • Version 1.0.1
    • Version 1.0.0
    • Version 1.1.13
    • Version 1.1.12
    • Version 1.1.11
    • Version 1.1.9
    • Version 1.1.8
    • Version 1.1.7
    • Version 1.1.6
    • Version 1.1.5
    • Version 1.1.4
    • Version 1.1.3
    • Version 1.1.2
    • Version 1.1.1
    • Version 1.1.0
    • Version 1.0.0
    • Version 1.0.4
    • Version 1.0.3
    • Version 1.0.2
    • Version 1.0.1
    • Version 1.0.0
Change +
© 2003–2024 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support