THotPDF.RegisterSeparation Method

 

THotPDF.RegisterSeparation

THotPDF

 

Вгору

Оголошує PDF 1.3+ Separation color space for spot-color print workflows (ISO 32000-1 8.6.6.4) Кожен call registers one spot ink і returns 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);

 

Опис

Separation color space lets PDF reference spot ink (наприклад Pantone color) by name Conforming print devices use actual ink; on-screen viewers і digital previewers fallback to supplied AlternateCS color at tint = 1.0, interpolating linearly toward no ink at tint = 0

 

ColorantName - ink name, наприклад 'Pantone 185 C' Spaces escaped to #20 in output PDF name per PDF 1.7 7.3.5; other PDF delimiter characters should be avoided

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

TintC1 - компоненти alternate-CS за повної сили фарби (tint = 1.0). Кількість компонентів має відповідати AlternateCS; значення в [0..1]. Зауважте, що для DeviceGray convention: 0 = black і 1 = white

 

Return value: auto-generated name (Sep1, Sep2, ...) Returns empty string when StrictVersionLock on and active Version below PDF 1.3; otherwise 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