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: 7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2    Statistic  


Renders whole PDF file in current PDF to an image.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 8.0 Yes Yes Yes Yes Yes
MBS( "DynaPDF.RenderPDFFileEx"; PDF; DestPath; Resolution; Width; Height; Flags; PixelFormat; Filter; Format )   More


Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
DestPath A file path for storing images. Can be folder for multiple images files or file for one file. If a folder, it must exist. "/Users/cs/Desktop/test.jpg"
Resolution The resolution you'd like to have for the image. If you pass zero, we use default resolution (72). 150
Width Desired width. 600
Height Desired height. 800
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"


Returns OK or error.


Renders whole PDF file in current PDF to an image.
The pages in memory could be imported from one or more external PDF files, e.g. with ImportPDFFile(), created with DynaPDF functions, or a combination of both.
The parameter DestPath can be a path to an existing directory or the file name of the output image. The latter type can be used with TIFF images because this format supports multi-page output. When a file path is used with a single page image format only the first page will be rendered.
The function checks whether the path is a directory or a file name.
The function can render pages in a specific resolution, or scale them to a given width or height.
Depending on which parameters are set the image size is calculated as follows:

  • Resolution > 0 and Width == 0 and Height == 0: Pages are rendered according to the given resolution. Note that PDF pages can be very large. Therefore, it is maybe not possible to render all pages in the wished resolution.
  • Resolution > 0 and Width < 0 and or Height < 0: Pages are rendered according to the given resolution. Negative values of Width and Height are interpreted as maximum width or height if Resolution is greater zero. Since PDF pages can be very large, it is recommended to set the maximum width and height to a value that is low enough so that no out of memory exception occurs, e.g. 5000 x 5000 pixels.
  • Resolution == 0 and Width > 0 or Height > 0: Pages are scaled to the given Width or Height. If Width and Height are greater zero then pages are scaled to that size independent of the original page format (not recommended). It is usually best to set the width or height to zero so that the function can calculate the missing value to preserve the aspect ratio.

On a 32 bit system it is possible to render PDF pages in RGB with up to around 1200 DPI, depending on the page format and available memory. The resolution of gray images can be higher but the encoder must be able to handle such large images. The PNG and bitmap encoders accept images in almost arbitrary resolutions but all other encoders can fail when the resolution is larger than about 2000 DPI.

Requires DynaPDF Pro license.

See also RenderPDFFileEx function in DynaPDF manual.

See also

Blog Entries

Created 21st December 2017, last changed 31st August 2018

DynaPDF.RenderPDFFile   -   DynaPDF.RenderPage

Feedback: Report problem or ask question.

MBS Xojo Plugins