ImageRef API in Capacitor Document Scanner SDK
ImageRef is a lightweight image reference type used throughout the Scanbot SDK to represent image data in a unified and effective manner.
Additionally, it acts as a universal interface for images that any component of the SDK captures, processes, or returns.
It enables memory efficient Image processing across the SDK and also makes it cross accessible across the SDKs on supported platforms.
ImageRef from Encoded Buffer
ImageRef can be created from an encoded image buffer, which is a base64 string containing the image data in a specific format (e.g., JPEG, PNG). This allows you to work with images that are already in memory without needing to save them to disk first.
loading...
ImageRef from File URI
ImageRef can also be created from a file URI, which is a string representing the location of an image file on the device's storage.
loading...
ImageRef from Serialized Ref
ImageRef can be created from a serialized reference, which is an object that contains an identifier string that can be used to retrieve the ImageRef later.
loading...
Utilizing ImageRef
Once you have an ImageRef, you can use it with various SDK components that accept ImageRef as input. ImageRef can also be used to save images to disk or convert them to encoded buffers for further processing.
loading...
If you need to use an ImageRef outside the current autorelease block, serialize it and later deserialize it within a new autorelease block. This ensures proper memory management and release when the ImageRef is no longer needed.
Buffer Serialization
The ImageRef can be serialized to a buffer and deserialized back to an ImageRef when needed.
loading...
Reference Serialization
An ImageRef can be serialized into an object with a uniqueId property and later deserialized to reconstruct the ImageRef.
loading...
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get free trial licenseScanbot SDK is part of the Apryse SDK product family
A mobile scan is just the start. With Apryse SDKs, you can expand mobile workflows into full cross‑platform document processing. Whether you need to edit PDFs, add secure digital signatures, or use a fast, customizable document viewer and editor, Apryse gives you the tools to build powerful features quickly.
Learn more
