API referenceCore SDK

pdfSetBlackGenFunction

Install real prepress ExtGState functions — /TR2 (transfer

C
BOOL32 __stdcall pdfSetTransferFunction(PPDF IPDF, int32_t Handle, uint8_t* Samples, int32_t NumSamples);
BOOL32 __stdcall pdfSetBlackGenFunction(PPDF IPDF, int32_t Handle, uint8_t* Samples, int32_t NumSamples);
BOOL32 __stdcall pdfSetHalftone(PPDF IPDF, int32_t Handle, double Frequency, double Angle, int32_t SpotFunction);
Delphi
function pdfSetTransferFunction(const IPDF: PPDF; Handle: Integer; Samples: PByte; NumSamples: Integer): LongBool; stdcall;
function pdfSetBlackGenFunction(const IPDF: PPDF; Handle: Integer; Samples: PByte; NumSamples: Integer): LongBool; stdcall;
function pdfSetHalftone(const IPDF: PPDF; Handle: Integer; Frequency, Angle: Double; SpotFunction: Integer): LongBool; stdcall;

Purpose. Install real prepress ExtGState functions — /TR2 (transfer function), /BG2 (black-generation function), and /HT (Type 1 halftone) — on an existing ExtGState resource. Siblings of pdfSetUndercolorRemovalFunction (Color-Space Creation and Color Conversion), sharing the identical sample-array-to-Type-0-function mechanism and the same FindGSByHandle ExtGState registry.

Description. All three are fully implemented (source-commented "G-35: install a real..." for each). pdfSetTransferFunction/ pdfSetBlackGenFunction both require NumSamples >= 2, identical validation to pdfSetUndercolorRemovalFunction.

Parameters.

ParameterDescription
IPDFDocument handle.
HandleHandle of an existing ExtGState.
Samples, NumSamples*(TransferFunction/BlackGenFunction)* Sampled function output table, >= 2 samples required.
Frequency, Angle, SpotFunction*(Halftone)* Halftone screen frequency (lpi), angle, and standard spot-function selector.

Return value. True if Handle resolves to a live ExtGState (and, for the sample-based pair, NumSamples >= 2); False otherwise.

See also. pdfSetUndercolorRemovalFunction.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category

Setters

Exported names

pdfSetBlackGenFunction

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.