API reference › Rendering & Viewer
pdfSetRenderingIntent
pdfSetRenderingIntent sets the document's (and
BOOL32 __stdcall pdfSetRenderingIntent(void* IPDF, uint32_t ImgHandle, TRenderingIntent Value);
TRenderingIntent __stdcall psrGetRenderingIntent(uint32_t DrawParms);
void __stdcall psrSetRenderingIntent(uint32_t* DrawParms, TRenderingIntent Value);
function pdfSetRenderingIntent(const IPDF: Pointer; ImgHandle: Cardinal; Value: TRenderingIntent): LongBool; stdcall;
function psrGetRenderingIntent(DrawParms: Cardinal): TRenderingIntent; stdcall;
procedure psrSetRenderingIntent(var DrawParms: Cardinal; Value: TRenderingIntent); stdcall;
Purpose. pdfSetRenderingIntent sets the document's (and optionally one specific image's) ICC rendering intent, genuinely reaching the output PDF. psrGetRenderingIntent/psrSetRenderingIntent read/write the rendering-intent bit-field (bits 16-19, mask $000F0000) of a psr*-subsystem DrawParms word — the same bit-packed-word mechanism documented for psrSetBlendMode/ psrSetLineCapStyle/psrSetLineJoinStyle/psrSetTextDrawMode elsewhere (Line Style, Opacity, and Graphics-State Flags) — unrelated to pdfSetRenderingIntent's per-document/ per-image state despite the shared name.
Description. pdfSetRenderingIntent, per an explicit source comment ("rendering intent now actually reaches the file ... Was write-only before"), is fully functional (not a historical no-op): it stores the document-wide FRenderingIntent, and if ImgHandle > 0 resolves to a known image, additionally tags that specific image's XObject with /Intent (only for the 4 valid ordinals 0..3 — AbsoluteColorimetric/Perceptual/RelativeColorimetric/Saturation); the general graphics-state ri operator is also emitted so vector/text fills honor the document-wide intent, not just images. psrGetRenderingIntent/ psrSetRenderingIntent are pure bit-shift accessors on the caller-owned DrawParms word, guarded only by a null-pointer check on the setter (if @DrawParms = nil then Exit).
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
ImgHandle | 0 for document-wide only; a specific image handle additionally tags that image's /Intent (only if Value is one of the 4 valid ordinals). |
Value | The rendering intent. |
DrawParms | *(psr\* only)* The caller-owned bit-packed word; psrSetRenderingIntent mutates bits 16-19 in place. |
Return value. pdfSetRenderingIntent: True if IPDF resolves (regardless of whether ImgHandle matched any image). psrGetRenderingIntent: the decoded 4-bit intent value.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Setters
pdfSetRenderingIntent
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.