Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3    Statistic  

DynaPDF.RenderPDFFileEx

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 )

Parameters

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"
0
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"

Result

Returns OK or error.

Description

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.

See also


DynaPDF.RenderPDFFile   -   DynaPDF.RenderPage

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins