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:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Renders a page to an image.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
WinPDF | 13.2 | ❌ No | ✅ Yes | ❌ No | ✅ Yes, on Windows | ❌ No |
Parameter | Description | Example | Flags |
---|---|---|---|
PDFRef | The reference number for the PDF document. | ||
Page | The page index. Zero based. |
0 | |
ImageType | The desired image type. JPEG, PNG, BMP, TIFF, GIF or HEIF. Default is JPEG. |
"JPEG" | Optional |
FileName | The file name to use for the returned image. | "page.jpg" | Optional |
DPI | The resolution you like to use. | 72 | Optional |
Returns container value or error.
Render preview in one Let statement:
Let([
// open from container value in variable
pdf = MBS( "WinPDF.LoadContainer"; $Container );
e1 = MBS("isError");
page = 0;
// render preview
image = If(e1; ""; MBS( "WinPDF.PageImage"; pdf; page; "JPEG"; "preview.jpg"; 144));
e2 = MBS("isError");
// free resources
r = MBS( "WinPDF.Release"; pdf)
];
// if no error, return image
If(e2; ""; image))
This function checks for a license.
Created 8th March 2023, last changed 16th April 2023