THotPDF.RegisterDeviceN Method

 

THotPDF.RegisterDeviceN

THotPDF

 

الأعلى

Declares a PDF 1.3+ DeviceN colour space backed by N user-supplied spot inks (ISO 32000-1 8.6.6.5). Generalises RegisterSeparation from one colorant to many: six-colour printing, metallic / fluorescent inks, custom PDF/X ink mixes, or any N-channel ink set.

 

Delphi syntax:

function RegisterDeviceN(const ColorantNames: array of AnsiString; const AlternateCS: AnsiString; const TintC1Matrix: array of Extended): AnsiString;

 

C++ syntax:

AnsiString RegisterDeviceN(const AnsiString* ColorantNames, int ColorantNameCount, const AnsiString& AlternateCS, const Extended* TintC1Matrix, int TintC1MatrixCount);

 

الوصف

يأخذ DeviceN عدد N من معاملات tint ضمن [0..1]، معاملًا واحدًا لكل colorant، ويحسب M من مكونات الإخراج في AlternateCS باستخدام تحويل tint خطي weighted-blend يبنيه HotPDF داخليًا كـ PostScript-calculator Function Type 4. إخراج القناة m هو مجموع tint[n] * TintC1Matrix[n*M + m] لكل colorant n، مع تقييده إلى [0..1] داخل مسار العرض

 

ColorantNames - مصفوفة تضم N من أسماء الأحبار. يكتب كل إدخال كاسم PDF؛ وتهرب المسافات إلى #20 وفق PDF 1.7 7.3.5. الاسم الخاص 'None' يحدد موضع colorant غير مستخدم. تحدد قائمة الأسماء أبعاد الإدخال N لمساحة الألوان الناتجة

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

TintC1Matrix - row-major N * M Extended array. Row n column m is colorant n's contribution to AlternateCS channel m at full strength (tint[n] = 1.0) with all other tints at zero. Length must be exactly Length(ColorantNames) * M.

 

القيمة المعادة: اسم مولد تلقائيًا مثل DevN1 وDevN2 وما بعدها. يعاد نص فارغ عندما يكون StrictVersionLock مفعّلًا وتكون Version النشطة أقل من PDF 1.3؛ وإلا يرفع إصدار المستند تلقائيًا إلى 1.3

 

Code Example

// Two-colorant DeviceN over DeviceRGB. Colorant 0 ('Red') is pure
// red at full strength, colorant 1 ('Blue') is pure blue. Mixing
// (0.5, 0.5) yields a 50/50 blend; (1, 1) saturates to magenta
var
  CSName: AnsiString;
  Mat: array[0..5] of Extended;
begin
  HPDF.Version := pdf14;
  HPDF.BeginDoc;
  Mat[0] := 1.0; Mat[1] := 0.0; Mat[2] := 0.0;  // Red row     -> (1, 0, 0)
  Mat[3] := 0.0; Mat[4] := 0.0; Mat[5] := 1.0;  // Blue row    -> (0, 0, 1)
  CSName := HPDF.RegisterDeviceN(
    ['Red', 'Blue'], 'DeviceRGB', Mat);
  HPDF.CurrentPage.SetFillColorSpace(CSName);
  HPDF.CurrentPage.SetFillColor([0.5, 0.5]);   // mid-purple
  HPDF.CurrentPage.Rectangle(60, 60, 200, 100);
  HPDF.CurrentPage.Fill;
  HPDF.EndDoc;
end;

 

انظر أيضا

RegisterSeparation, RegisterLabColorSpace, Version, PDF Filter Support