DynaPDF.RenderJob
-----------------

Renders PDF pages in the background.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [15.2](newinversion152.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.RenderJob"; Job { ; InputContainer; Sync } ) 

**MBS**( **"DynaPDF.RenderJob";** /\* Renders PDF pages in the background. \*/  
**$Job**; /\* The job data as JSON.e.g. $json \*/   
**$InputContainer**; /\* Optional; Input PDF as a container.  
Alternatively pass InputPath in the job JSON.e.g. RenderJob::PDF \*/   
**$Sync**) /\* Optional; Pass 1 to run the job synchronously.  
Server side always runs synchronously.  
But client runs by default asynchronously.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Job | The job data as JSON. | $json |  |
| InputContainer | Input PDF as a container.   Alternatively pass InputPath in the job JSON. | RenderJob::PDF | Optional |
| Sync | Pass 1 to run the job synchronously.   Server side always runs synchronously.   But client runs by default asynchronously. | 0 | Optional |

### Result

Returns OK, JSON or error.

### Description

Renders PDF pages in the background.  
This allows you to specify a JSON with the job and run it in background in FileMaker Pro or synchronously in FileMaker Server. For synchronous mode, we return a JSON and otherwise pass it to the script triggered as parameter.  
  
Input parameters are show in the first table and result/script parameter JSON is shown in the second table.  
  
| Name | Type | Default | Description |
|---|---|---|---|
| InitCMFlags | TPDFInitCMFlags | icmBPCompensation = 1 | Flags for initialization of Color Management |
| DestSpace | TPDFColorSpace | csDeviceRGB = 0 | Destination color space for Color Mangement |
| PixFmt | TPDFPixFormat | pxfRGB = 2 | The desired pixel format. |
| Flags | TRasterFlags | rfDefault = 0 | The raster flags. |
| Filter | TCompressionFilter | cfFlate = 0 | The desired compression filter. |
| Format | TImageFormat | ifmJPEG = 1 | The desired image format. |
| Resolution | Number |  | The resolution to use for the PDF pages. This calculates width and height automatically. |
| Width | Number |  | The desired width of the images. |
| Height | Number |  | The desired height of the images. |
| PageRangeStart | Number | 1 | The first page to start rendering. |
| PageRangeLength | Number | -1 | The number of pages to render. Use -1 for all pages. |
| PasswordType | TPwdType | ptOpen = 0 | The password type. Either open password (0) or owner password (1). |
| JPEGQuality | Number |  | The JPEG quality to use. If not set, the default setting is 70. Range 0 to 100. |
| Password | String |  | The password for opening the PDF file. |
| InputPath | String |  | The native file path for the PDF to read. |
| FinishedScriptName | String |  | The script to trigger when done. |
| FinishedFileName | String |  | The filename for the script to trigger when done. |
| outputSQL | String |  | The SQL to run for saving images to the database. Can be INSERT or UPDATE statement and use $page as variable for the page number or $container for the image itself. |
| outputSQLFileName | String |  | The file name for the SQL execution. Can be empty. |
| outputPath | String |  | The output file path to write image files. Should include file name with extension and can use $page as variable for the page number. |
| DefInGray | Base64 String |  | Gray Colorspace for Color Management |
| DefInRGB | Base64 String |  | RGB Colorspace for Color Management |
| DefInCMYK | Base64 String |  | CMYK Colorspace for Color Management |
| DeviceProfile | Base64 String |  | Device Colorspace for Color Management |
| SoftProof | Base64 String |  | Soft Proofing Colorspace for Color Management |

  
| Name | Type | Description |
|---|---|---|
| FilesCount | Number | Number of files written. |
| SQLErrorsCount | Number | Number of SQL errors (only in synchronous mode) |
| ErrorMessage | Text | The error message from DynaPDF. |
| ErrorCode | Number | The error code from DynaPDF. |
| ErrorType | Number | The error type from DynaPDF. |
| PageCount | Number | The number of pages in the input PDF. |
| PageRendered | Number | The number of pages rendered. |
| InputPath | Text | The PDF input path used. |
| Files | Array of Text | The list of files created. |
| SQLErrors | Array of Text | The list of SQL errors. |

  
e.g. the output path would be "/tmp/test/Page$page.jpg" to and output SQL could be "INSERT INTO RenderJob (Page, Image) VALUES ($page, $container)" to insert the images to a table.  
  
For running the scripts the current script needs to finish. And for SQL to run and insert or update records, you need to have a script pause or a time where no script runs.  
### See also

- [DynaPDF.RenderPage](DynaPDFRenderPage.md)

### Release notes

- **Version 15.2**
    - Added [DynaPDF.RenderJob](https://www.mbsplugins.eu/DynaPDFRenderJob.shtml) function.

### Example Databases

- [DynaPDF/RenderJob](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/RenderJob.shtml#1ScriptAnchor_)

### Blog Entries

- [News in MBS FileMaker Plugin 15.2](https://www.mbsplugins.de/archive/2025-05-13/News_in_MBS_FileMaker_Plugin_1/monkeybreadsoftware_blog_filemaker)
- [Neues MBS Plugin 15.2 für Claris FileMaker](https://www.mbsplugins.de/archive/2025-05-06/Neues_MBS_Plugin_152_für_Clar/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 15.2 for Claris FileMaker](https://www.mbsplugins.de/archive/2025-05-06/MBS_Plugin_152_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.2pr1](https://www.mbsplugins.de/archive/2025-04-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 16th March 2025 , last changed 28th March 2025

  
[DynaPDF.RenameSpotColor](DynaPDFRenameSpotColor.md) - [DynaPDF.RenderPDFFile](DynaPDFRenderPDFFile.md)

[HTML Version](DynaPDFRenderJob.shtml)