THotPDF.CreateIndirectFontDict Method

 

THotPDF.CreateIndirectFontDict

THotPDF

 

Κορυφή

Κατανέμει ένα νέο κενό THPDFDictionaryObject καταχωρημένο ως indirect PDF object στον πίνακα IndirectObjects του εγγράφου. Callers που δημιουργούν custom font / color / OCG / Function dicts τα οποία πρέπει να σειριοποιηθούν ως "N G R" indirect references συμπληρώνουν το επιστρεφόμενο dict και το περνούν μέσω οποιουδήποτε API δέχεται υπάρχον THPDFDictionaryObject. Αυτή είναι η public-API μορφή του παλαιού protected helper CreateIndirectDictionary

 

Σύνταξη Delphi:

function CreateIndirectFontDict: THPDFDictionaryObject;

 

C++ syntax:

THPDFDictionaryObject* CreateIndirectFontDict();

 

Περιγραφή

Το επιστρεφόμενο dict ξεκινά κενό (χωρίς entries). Ο καλών προσθέτει entries μέσω AddNameValue, AddStringValue, AddNumericValue, AddValue κ.λπ. Το dict ανήκει στο έγγραφο, μην το απελευθερώνετε χειροκίνητα. Αν και η μέθοδος ονομάζεται "FontDict" για την κύρια προβλεπόμενη χρήση της με SetFormUnicodeFontDict, το επιστρεφόμενο dict δεν έχει font-specific σημασιολογία και μπορεί να περιέχει οποιοδήποτε PDF dictionary content χρειάζεται ο καλών

 

Return value: an empty indirect THPDFDictionaryObject.

 

Code Example

// Build a minimal Type 0 / CIDFontType2 + Identity-H font dict for
// AcroForm Tx widget AP rendering
var
  F0: THPDFDictionaryObject;
begin
  HPDF.BeginDoc;
  F0 := HPDF.CreateIndirectFontDict;
  F0.AddNameValue('Type', 'Font');
  F0.AddNameValue('Subtype', 'Type0');
  F0.AddNameValue('BaseFont', 'MyCJK');
  F0.AddNameValue('Encoding', 'Identity-H');
  // ... fill DescendantFonts / CIDSystemInfo / FontDescriptor /
  HPDF.SetFormUnicodeFontDict('F0', F0);
  HPDF.EndDoc;
end;

 

Δείτε επίσης

SetFormUnicodeFontDict