Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4    Statistic    FMM    Blog  


Renders a page in current PDF to an image.

Component Version macOS Windows Linux Server 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 Flags
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 Optional
Width The width of the output image. Can be zero to use page width or to scale based on height. 800 Optional
Height The height of the output image. Can be zero to use page height or to scale based on width. 600 Optional
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"

Valid flags: Default, ScaleToMediaBox, IgnoreCropBox, ClipToArtBox, ClipToBleedBox, ClipToTrimBox, ExclAnnotations, ExclFormFields, SkipUpdateBG, Rotate90, Rotate180, Rotate270, InitBlack, CompositeWhite, ExclPageContent, ExclButtons, ExclCheckBoxes, ExclComboBoxes, ExclListBoxes, ExclTextFields, ExclSigFields, ScaleToBBox, DisableAAClipping, DisableAAText, DisableAAVector, DisableAntiAliasing, DisableBiLinearFilter, ClipBoxMask, RenderInvisibleText.
0 Optional
PixelFormat The pixel format. Can be 1bit, gray, RGB, BGR, RGBA, BGRA, ARGB, ABGR, CMYK, CMYKA and GrayA. Default is RGB. "RGB" Optional
Filter The compression filter to use. Can be Flate, JPEG, CCITT3, CCITT4, LZW or JP2K. Default is JPEG. "JPEG" Optional
Format The image format to use. Can be TIFF, JPEG, PNG, BMP or JPC. Default is JPEG. "JPEG" Optional
Filename 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. $name Optional
DestPath Optional, a file path for storing image instead of a container. "/Users/cs/Desktop/test.jpg" Optional


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.
Please use DynaPDF.InitColorManagement or DynaPDF.InitColorManagementEx to initialize color management, so conversions to other colorspaces like CMYK work better.

You can use DynaPDF.SetPageBBox or DynaPDF.SetBBox to clip the page with the crop box and render only that portion.


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)]

Render in one formula:

// input: PDFDocumentContainer
Let (
~PDFObject = MBS("DynaPDF.New");
~error = MBS("IsError");

~x = MBS("DynaPDF.OpenPDFFromContainer"; ~PDFObject; PDFDocumentContainer);
~error = ~error OR MBS("IsError");

~x = MBS("DynaPDF.ImportPDFPage"; ~PDFObject; 1);
~error = ~error OR MBS("IsError");

~PageIndex = 1;
~Resolution = 150 ;
~Width = 0;
~Height = 0;
~Flags = 0;
~PixelFormat = "RGB";
~Filter = "JPEG";
~Format = "PNG";
~Result = MBS("DynaPDF.RenderPage"; ~PDFObject; ~PageIndex ; ~Resolution; ~Width; ~Height; ~Flags; ~PixelFormat; ~Filter; ~Format);
~error = ~error OR MBS("IsError");

~x = MBS("DynaPDF.Release"; ~PDFObject)];
If(~error; ""; ~Result))

Render page as CMYK to tiff file:

Set Variable [ $r ; Value: MBS("DynaPDF.RenderPage"; $pdf; 1; 300; 0; 0; "default"; "CMYK"; "Flate"; "Tiff"; ""; "/Users/cs/Desktop/test.tif") ]

See also

Release notes

  • Version 10.1
    • Fixed problem with DynaPDF.RenderPage not returning container if you pass empty file path parameter.

Example Databases

Blog Entries

FileMaker Magazin

Created 18th August 2014, last changed 26th May 2021

DynaPDF.RenderPDFFileEx - DynaPDF.ReplaceImage

Feedback: Report problem or ask question.

MBS Xojo PDF Plugins

Start Chat