|
Declares a PDF 1.3+ DeviceN color space backed by N user-supplied spot inks (ISO 32000-1 8.6.6.5). Generalises RegisterSeparation da un colorante a molti: stampa a sei colori, inchiostri metallici / fluorescenti, miscele di inchiostri PDF/X personalizzate o qualsiasi set di inchiostri a N canali.
Sintassi Delphi:
function RegisterDeviceN(const ColorantNames: array di AnsiString; const AlternateCS: AnsiString; const TintC1Matrix: array di Extended): AnsiString;
Sintassi C++:
AnsiString RegisterDeviceN(const AnsiString* ColorantNames, int ColorantNameCount, const AnsiString& AlternateCS, const Extended* TintC1Matrix, int TintC1MatrixCount);
Descrizione
DeviceN accetta N operandi tint in [0..1], uno per colorante, e calcola M componenti di output in AlternateCS usando una trasformazione tint a miscela pesata lineare che HotPDF costruisce internamente come Function Type 4 da calcolatrice PostScript. L'output per il canale m è la somma su tutti i coloranti n di tint[n] * TintC1Matrix[n*M + m], limitato a [0..1] dalla pipeline di rendering.
ColorantNames - array of N ink names. Each entry is written as a PDF name; spaces are escaped to #20 secondo PDF 1.7 7.3.5. Il nome speciale 'None' marca uno slot di colorante inutilizzato. L'elenco dei nomi definisce le N dimensioni di input dello spazio colore risultante.
AlternateCS - 'DeviceGray' (M = 1), 'DeviceRGB' (M = 3), or 'DeviceCMYK' (M = 4). Any other value raises an exception.
TintC1Matrix - row-major N * M array Extended. La riga n column m è un colorante ncontribuisce a AlternateCS channel m at full strength (tint[n] = 1.0) with all other tints at zero. Length must be exactly Length(ColorantNames) * M.
Valore restituito: an auto-generated name (DevN1, DevN2, ...). Returns an empty string when StrictVersionLock è attivo e la Version is below PDF 1.3 (otherwise the document version auto-bumps to 1.3).
Esempio di codice
// 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;
Vedi anche:
RegisterSeparation, RegisterLabColorSpace, Version, Supporto dei filtri PDF
|