|
Reserveert een nieuw leeg THPDFDictionaryObject dat als een indirect PDF-object in de IndirectObjects-tabel van het document wordt geregistreerd. Auteurs die aangepaste lettertype-, kleur-, OCG- of Function-dictionaries bouwen die als indirecte verwijzingen in de vorm "N G R" moeten worden geserialiseerd, vullen de geretourneerde dictionary en geven die door aan elke API die een bestaande THPDFDictionaryObject accepteert. Dit is de publieke API-vorm van de al langer bestaande protected helper CreateIndirectDictionary
Delphi-syntaxis:
function CreateIndirectFontDict: THPDFDictionaryObject;
C++-syntaxis:
THPDFDictionaryObject* CreateIndirectFontDict();
Beschrijving
De geretourneerde dictionary begint leeg, dus zonder items. De aanroeper voegt items toe via AddNameValue, AddStringValue, AddNumericValue, AddValue, enzovoort. De dictionary is eigendom van het document; geef die niet handmatig vrij. Hoewel de methode "FontDict" heet vanwege het primaire beoogde gebruik met SetFormUnicodeFontDict, heeft de geretourneerde dictionary geen fonts-specifieke semantiek - hij kan elke PDF-dictionaryinhoud bevatten die de aanroeper nodig heeft
Retourwaarde: een lege indirecte THPDFDictionaryObject
Codevoorbeeld
// 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;
Zie ook
SetFormUnicodeFontDict
|