API referenceRendering & Viewer

pdfRenderPDFFileEx

Render the currently open *import* file (opened via

C
BOOL32 __stdcall pdfRenderPDFFileA(PPDF IPDF, const char* OutFile, uint32_t Resolution, TRasterFlags Flags, TPDFPixFormat PixFmt, TCompressionFilter Filter, TImageFormat Format);
BOOL32 __stdcall pdfRenderPDFFileExA(PPDF IPDF, const char* OutFile, uint32_t Resolution, int32_t Width, int32_t Height, TRasterFlags Flags, TPDFPixFormat PixFmt, TCompressionFilter Filter, TImageFormat Format);
Delphi
function pdfRenderPDFFileA(const IPDF: PPDF; const OutFile: PAnsiChar; Resolution: Cardinal; Flags: TRasterFlags; PixFmt: TPDFPixFormat; Filter: TCompressionFilter; Format: TImageFormat): LongBool; stdcall;
function pdfRenderPDFFileExA(const IPDF: PPDF; const OutFile: PAnsiChar; Resolution: Cardinal; Width, Height: Integer; Flags: TRasterFlags; PixFmt: TPDFPixFormat; Filter: TCompressionFilter; Format: TImageFormat): LongBool; stdcall;

Purpose. Render the **currently open *import* file** (opened via pdfOpenImportFile*, not the live document being edited) to an image file — pdfRenderPDFFile is the whole-import-document counterpart to pdfRenderPageToImage's single-live-page rendering.

Description. Both forward to RenderImportPDFBMP, which (per its inline comments) renders the import source's page(s) using RenderImportPageRGB — a build of TRenderResources from the *import* document's own decoded content, media box, embedded 8-bit Flate-raw image XObjects, and BuildRenderResources(D) for any authored-document resources (empty when the target document has no authored content of its own — the typical case when this API is used purely as an import-then-rasterize conversion tool). Filter is reduced to a single boolean(Ord(Filter) = 0) or (Ord(Filter) = 6) — passed to RenderImportPDFBMP; every other ordinal value maps to the opposite boolean, an implicit "is this one of these two specific filter kinds" test rather than a full compression-filter selection. The plain form (pdfRenderPDFFile) always auto-sizes from Resolution (Width/Height forced to 0); the Ex form allows explicit Width/Height, taking priority when positive, same convention as pdfRenderPageToImage.

Parameters.

ParameterDescription
IPDFDocument handle (whose *import source*, not itself, is rendered).
OutFileOutput file path.
ResolutionDPI for auto-sizing (plain form always auto-sizes).
Width, Height*(Ex only)* Explicit output size, takes priority over Resolution.
FlagsAccepted; not observed to affect this path's output.
PixFmtAccepted; not observed to affect this path's output.
FilterReduced to a single boolean (Ord(Filter) is 0 or 6) rather than a real filter selection.
FormatSame TIFF/BigTIFF-vs-everything-else-is-BMP collapse as pdfRenderPageToImage.

Return value. True if an import file is open and rendering/write succeeded; False otherwise.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Rendering & Viewer
Category

Core

Exported names

pdfRenderPDFFileExA pdfRenderPDFFileExW

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.