THotPDF.RegisterSeparation Method

 

THotPDF.RegisterSeparation

THotPDF

 

顶部

声明面向专色打印工作流的 PDF 1.3+ Separation 颜色空间(ISO 32000-1 8.6.6.4)。每次调用注册一种专色油墨,返回自动生成的颜色空间名称(Sep1、Sep2 等),可与 THPDFPage.SetFillColorSpace / SetStrokeColorSpace + SetFillColor([tint]) / SetStrokeColor([tint]) 配合使用。

 

Delphi 语法:

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

 

C++ 语法:

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

 

说明

Separation 颜色空间让 PDF 按名称引用专色油墨(如 Pantone 颜色)。合规的打印设备使用实际油墨;屏幕查看器与数字预览器在 tint = 1.0 时回退到提供的 AlternateCS 颜色,并向 tint = 0 的“无油墨”线性插值。

 

ColorantName - 油墨名称,例如 'Pantone 185 C'。按 PDF 1.7 7.3.5,空格会在输出的 PDF 名称中转义为 #20;应避免其他 PDF 分隔字符(圆括号、方括号、斜杠、百分号)。

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

TintC1 - 全油墨强度(tint = 1.0)下的 alternate-CS 分量。分量数必须匹配 AlternateCS;值在 [0..1] 内。注意对 DeviceGray,约定是 0 = 黑、1 = 白(与图像 BlackIs1 默认相反)。

 

返回值: 自动生成的名称(Sep1、Sep2 等)。StrictVersionLock 开启且当前 Version 低于 PDF 1.3 时返回空字符串(否则文档版本自动提升到 1.3)。

 

代码示例

// 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 过滤器支持