THotPDF.RegisterSeparation Method

 

THotPDF.RegisterSeparation

THotPDF

 

Top

Declares a PDF 1.3+ Separation color space for spot-color print workflows (ISO 32000-1 8.6.6.4). Each call registers one spot ink and returns an auto-generated color-space name (Sep1, Sep2, ...) usable with THPDFPage.SetFillColorSpace / SetStrokeColorSpace + SetFillColor([tint]) / SetStrokeColor([tint]).

 

Delphi syntax:

function RegisterSeparation(const ColorantName: AnsiString; const AlternateCS: AnsiString; const TintC1: array of Extended): AnsiString;

 

C++ syntax:

AnsiString RegisterSeparation(const AnsiString& ColorantName, const AnsiString& AlternateCS, const Extended* TintC1, int TintC1Count);

 

Description

A Separation color space lets a PDF reference a spot ink (e.g., a Pantone color) by name. Conforming print devices use the actual ink; on-screen viewers and digital previewers fall back to the supplied AlternateCS color at tint = 1.0, interpolating linearly toward "no ink" at tint = 0.

 

ColorantName - the ink name, e.g. 'Pantone 185 C'. Spaces are escaped to #20 in the output PDF name per PDF 1.7 7.3.5; other PDF delimiter characters (parentheses, brackets, slashes, percent signs) should be avoided.

AlternateCS - 'DeviceGray' (1 component), 'DeviceRGB' (3), or 'DeviceCMYK' (4). Any other value raises an exception.

TintC1 - alternate-CS components at full ink strength (tint = 1.0). Component count must match AlternateCS; values are in [0..1]. Note that for DeviceGray, the convention is 0 = black and 1 = white (opposite of the image BlackIs1 default).

 

Return value: an auto-generated name (Sep1, Sep2, ...). Returns an empty string when StrictVersionLock is on and the active Version is below PDF 1.3 (otherwise the document version auto-bumps to 1.3).

 

Code Example

// Register a Pantone-style spot ink backed by CMYK, paint four tint
// swatches showing the linear progression from no ink to full ink.
var
  SpotName: AnsiString;
  T: Integer;
begin
  HPDF.Version := pdf14;
  HPDF.BeginDoc;
  SpotName := HPDF.RegisterSeparation(
    'Pantone 185 C',                 // ink name (spaces auto-escaped)
    'DeviceCMYK',                    // alternate CS for screen / digital
    [0.0, 0.95, 0.75, 0.0]);         // CMYK at tint = 1.0
  HPDF.CurrentPage.SetFillColorSpace(SpotName);
  for T := 1 to 4 do
  begin
    HPDF.CurrentPage.SetFillColor([T * 0.25]);
    HPDF.CurrentPage.Rectangle(60 + (T - 1) * 100, 100, 80, 60);
    HPDF.CurrentPage.Fill;
  end;
  HPDF.EndDoc;
end;

 

See Also

RegisterDeviceN, RegisterLabColorSpace, Version, PDF Filter Support