THotPDF.RegisterSeparation Method

 

THotPDF.RegisterSeparation

THotPDF

 

Κορυφή

Δηλώνει PDF 1.3+ Separation color space για spot-color print workflows (ISO 32000-1 8.6.6.4). Κάθε κλήση καταχωρεί ένα spot ink και επιστρέφει auto-generated color-space name (Sep1, Sep2, ...) που μπορεί να χρησιμοποιηθεί με 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 επιτρέπει σε PDF να αναφέρεται σε spot ink (π.χ. Pantone color) με name. Τα conforming print devices χρησιμοποιούν το πραγματικό ink· οι on-screen viewers και digital previewers κάνουν fallback στο παρεχόμενο AlternateCS color στο tint = 1.0, παρεμβάλλοντας γραμμικά προς "no ink" στο tint = 0

 

ColorantName - το ink name, π.χ. 'Pantone 185 C'. Τα spaces γίνονται escaped σε #20 στο output PDF name σύμφωνα με PDF 1.7 7.3.5· άλλοι PDF delimiter characters (parentheses, brackets, slashes, percent signs) πρέπει να αποφεύγονται

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

TintC1 - alternate-CS components σε full ink strength (tint = 1.0). Το component count πρέπει να ταιριάζει με το AlternateCS· οι values είναι στο [0..1]. Σημειώστε ότι για DeviceGray, η σύμβαση είναι 0 = black και 1 = white (αντίθετα από το image BlackIs1 default)

 

Return value: auto-generated name (Sep1, Sep2, ...). Επιστρέφει κενό string όταν το StrictVersionLock είναι on και το active Version είναι κάτω από PDF 1.3 (διαφορετικά το document version γίνεται auto-bump σε 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