THotPDF.RegisterSeparation Method

 

THotPDF.RegisterSeparation

THotPDF

 

傳回頂部

宣告用於 spot-color print workflows 的 PDF 1.3+ Separation color space (ISO 32000-1 8.6.6.4)。每次呼叫會註冊一個 spot ink,並傳回自動產生的 color-space name(Sep1、Sep2、...),可搭配 THPDFPage.SetFillColorSpace / SetStrokeColorSpace + SetFillColor([tint]) / SetStrokeColor([tint]) 使用

 

Delphi 語法:

ColorantName - ink name,例如 ;應避免其他 PDF delimiter characters(parentheses、brackets、slashes、percent signs)

 

C++ 語法:

TintC1 - full ink strength(tint = 1.0)時的 alternate-CS components。component count 必須符合 AlternateCS;values 位於 [0..1]。注意,對 DeviceGray 而言,慣例是 0 = black、1 = white,這與 image BlackIs1 default 相反

 

說明

Separation color space 可讓 PDF 依名稱參照 spot ink(例如 Pantone color)。符合規範的 print devices 會使用實際 ink;螢幕 viewers 與 digital previewers 會在 tint = 1.0 時 fallback 到提供的 AlternateCS color,並向 tint = 0 的「無 ink」線性插值

 

ColorantName - ink name,例如 'Pantone 185 C'。依 PDF 1.7 7.3.5,空格會在 output PDF name 中 escape 為 #20;應避免其他 PDF delimiter characters(parentheses、brackets、slashes、percent signs)

AlternateCS - 'DeviceGray'(1 個 component)、'DeviceRGB'(3 個)或 'DeviceCMYK'(4 個)。任何其他 value 都會 raise exception

TintC1 - full ink strength(tint = 1.0)時的 alternate-CS components。component count 必須符合 AlternateCS;values 位於 [0..1]。注意,對 DeviceGray 而言,慣例是 0 = black、1 = white,這與 image BlackIs1 default 相反

 

傳回值: 自動產生的 name(Sep1、Sep2、...)。當 StrictVersionLock 啟用且目前 Version 低於 PDF 1.3 時會傳回空字串;否則檔案版本會自動提升到 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;

 

請參閱

RegisterDeviceN, RegisterLabColorSpace, Version, PDF 篩選器支援