Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.RenderPDFFile
Renders whole PDF file in current PDF to an image.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 5.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
The PDF reference returned from DynaPDF.New. | |||
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" | Optional |
Resolution | The resolution you'd like to have for the image. If you pass zero, we use default resolution (72). | 150 | 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" |
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 |
Result
Returns OK or error.
Description
Renders whole PDF file 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.
This can write multipage tiff files or a folder of image files.
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.
This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.
See also RenderPDFFile function in DynaPDF manual.
Examples
Render PDF to desktop with several JPEG pages:
$result = MBS( "DynaPDF.RenderPDFFile"; $PDF; "/Users/cs/Desktop"; 150; 0; "RGB"; "JPEG"; "JPEG" )
Render TIFF with higher resolution:
$result = MBS( "DynaPDF.RenderPDFFile"; $PDF; "c:\test.tif"; 150; 0; "RGB"; "Flate"; "TIFF" )
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.RenderPDFFile"; $PDF; "c:\test.tif"; 150; 0; "RGB"; "Flate"; "TIFF" ) )]
# Put in Container
Set Field [Test::PageImage; $r]
# cleanup
Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]
See also
- DynaPDF.ImportPDFFile
- DynaPDF.InitColorManagement
- DynaPDF.InitColorManagementEx
- DynaPDF.Initialize
- DynaPDF.OpenPDFFromContainer
- DynaPDF.Release
- DynaPDF.RenderPage
- DynaPDF.RenderPDFFileEx
- DynaPDF.SetOCGState
- Path.FileMakerPathToNativePath
Release notes
- Version 8.0
Blog Entries
- MBS FileMaker Plugin, version 6.4pr3
- MBS FileMaker Plugin, version 5.3pr1
- MBS Filemaker Plugin, version 4.5pr4
This function checks for a license.
Created 12nd December 2014, last changed 17th July 2022