Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.2   8.3   8.4   8.5   9.0   9.1   9.2   9.3   9.4   9.5    Statistic  


Renders a page in current PDF to an image.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 3.0 Yes Yes Yes Yes Yes
MBS( "DynaPDF.RenderPage"; PDF; PageIndex; Resolution; Width; Height; Flags; PixelFormat; Filter; Format { ; Filename; DestPath } )   More


Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
PageIndex The page number between 1 and DynaPDF.GetPageCount. 1
Resolution The resolution you'd like to have for the image. If you pass zero, we use default resolution (72). 150
Width The width of the output image. Can be zero to use page width or to scale based on height. 800
Height The height of the output image. Can be zero to use page height or to scale based on width. 600
Flags Flags for rendering. Use 0 for the default flags. For other values, please look into dynapdf manual.
With version 6.4 of our plugin, you can also specify this by passing in text string, e.g. "Rotate90¶ClipToTrimBox"
PixelFormat The pixel format. Can be 1bit, gray, RGB, BGR, RGBA, BGRA, ARGB, ABGR, CMYK, CMYKA and GrayA. Default is RGB. "RGB"
Filter The compression filter to use. Can be Flate, JPEG, CCITT3, CCITT4, LZW or JP2K. Default is JPEG. "JPEG"
Format The image format to use. Can be TIFF, JPEG, PNG, BMP or JPC. Default is JPEG. "JPEG"
Filename Optional
The file name to use for the container value. Default is page with right file extensions for image. Pass any value if you use DestPath parameter.
DestPath Optional
Optional, a file path for storing image instead of a container.


Returns container value with image or error message.


Renders a page in current PDF to an image.
You can choose the format and filter, but please make sure they match as not all combinations are valid.

Requires DynaPDF Pro license for the raster engine to create bitmaps from PDF pages.


Render page 5 with default options:

$ImageData = MBS( "DynaPDF.RenderPage"; $PDF; 5 )

Render page 5 with higher resolution:

$ImageData = MBS( "DynaPDF.RenderPage"; $PDF; 5; 150 )

Render page 5 to file:

$result = MBS( "DynaPDF.RenderPage"; $PDF; 5; 150; 0; 0; 0; "RGB"; "JPEG"; "JPEG"; ""; "/Users/cs/Desktop/test.jpg" )

Open PDF and render page as image to container:

# Start new PDF workspace
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
# Load PDF from container
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Test::data)]
# Import all pages
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFFile"; $pdf)]
# Render one page as Picture
Set Variable [$r; Value:MBS("DynaPDF.RenderPage"; $pdf; Test::PageIndex)]
# Put in Container
Set Field [Test::PageImage; $r]
# cleanup
Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]

See also

Example Databases

Blog Entries

Created 18th August 2014, last changed 26th September 2019

DynaPDF.RenderPDFFileEx   -   DynaPDF.ReplaceImage

Feedback: Report problem or ask question.

MBS FileMaker Plugins