DocumentCameraScan.PageImage
----------------------------

Queries a page as image.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DocumentCameraScan](component_DocumentCameraScan.md) | [10.0](newinversion100.md) | ❌ No | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "DocumentCameraScan.PageImage"; Index { ; ImageType; FileName } ) 

**MBS**( **"DocumentCameraScan.PageImage";** /\* Queries a page as image. \*/  
**$Index**; /\* The index of the page.  
Range is 0 to [DocumentCameraScan.PageCount](DocumentCameraScanPageCount.md)-1.e.g. 0 \*/   
**$ImageType**; /\* Optional; The type of image to return.   
Either JPEG or PNG. Default is JPEG.e.g. "JPEG" \*/   
**$FileName**) /\* Optional; The filename to use for the picture.   
Default is "image" with the extension matching the image type.e.g. "test.jpg" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Index | The index of the page.   Range is 0 to [DocumentCameraScan.PageCount](DocumentCameraScanPageCount.md)-1. | 0 |  |
| ImageType | The type of image to return.    Either JPEG or PNG. Default is JPEG. | "JPEG" | Optional |
| FileName | The filename to use for the picture.    Default is "image" with the extension matching the image type. | "test.jpg" | Optional |

### Result

Returns container value or error.

### Description

Queries a page as image.  
See [DocumentCameraScan.PageCount](DocumentCameraScanPageCount.md) for the count of pages.  
  
You may use [PDFKit](component_PDFKit.md) functions to create a PDF document if needed.  
### Examples

Import scan result:

 Set Variable \[ $count ; Value: MBS ( "[DocumentCameraScan.PageCount](DocumentCameraScanPageCount.md)" ) \]   
If \[ $count &gt; 0 \]   
 Set Variable \[ $index ; Value: 0 \]   
 Loop  
 # store image  
 New Record/Request  
 Set Field \[ Contacts::Video ; MBS ( "DocumentCameraScan.PageImage"; $Index ; "PNG"; "test.png") \]   
 Commit Records/Requests \[ With dialog: On \]   
 # next  
 Set Variable \[ $index ; Value: $index + 1 \]   
 Exit Loop If \[ $index ≥ $count \]   
 End Loop  
End If  
### See also

- [DocumentCameraScan.Clear](DocumentCameraScanClear.md)
- [DocumentCameraScan.ErrorMessage](DocumentCameraScanErrorMessage.md)
- [DocumentCameraScan.PageCount](DocumentCameraScanPageCount.md)

### Example Databases

- [iOS/Examples/DocumentCameraScan test](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/iOS/Examples/DocumentCameraScan%20test.shtml#3ScriptAnchor_)

### Blog Entries

- [Document Camera Scan functions for FileMaker iOS SDK](https://www.mbsplugins.de/archive/2020-01-08/Document_Camera_Scan_functions/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 6th January 2020 , last changed 26th January 2021

  
[DocumentCameraScan.PageCount](DocumentCameraScanPageCount.md) - [DocumentCameraScan.Scan](DocumentCameraScanScan.md)

[HTML Version](DocumentCameraScanPageImage.shtml)