Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
WinPDF.PageImage
Renders a page to an image.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
WinPDF | 13.2 | ❌ No | ✅ Yes | ❌ No | ✅ Yes, on Windows | ❌ No |
MBS( "WinPDF.PageImage"; PDFRef; Page { ; ImageType; FileName; DPI } ) More
Parameters
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 |
Result
Returns container value or error.
Description
Renders a page to an image.Outputs a stream of data, which represents a Portable Document Format (PDF) page's contents as image.
Takes a set of display settings, applies them to the output of a Portable Document Format (PDF) page's contents, and creates a stream with the customized, rendered output as an synchronous action. This asynchronous action can be used to create a customized display image of the Portable Document Format (PDF) page.
See also DynaPDF.RenderPage for cross platform projects or PDFKit.GetPDFPageImage for macOS and iOS.
Examples
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))
See also
- DynaPDF.RenderPage
- GMImage.NewFromContainer
- GMImage.NewFromFile
- IsError
- OCR.SetImage
- PDFKit.GetPDFPageImage
- WinPDF.LoadContainer
- WinPDF.PageImageAtSize
- WinPDF.Release
Release notes
- Version 13.2
- Fixed problem in WinPDF.PageImageAtSize when passing width and height as zero.
Example Databases
Blog Entries
This function checks for a license.
Created 8th March 2023, last changed 3th October 2023