THotPDF.CreateIndirectFontDict Method

 

THotPDF.CreateIndirectFontDict

THotPDF

 

傳回頂部

設定一個全新的空 THPDFDictionaryObject,並在檔案的 IndirectObjects table 中註冊為 indirect PDF object。建立 custom font / color / OCG / Function dicts 且必須以 "N G R" indirect references 序列化的呼叫端,可填入傳回的 dict,並將它傳給任何接受既有 THPDFDictionaryObject 的 API。這是 long-standing protected CreateIndirectDictionary helper 的 public-API formTHPDFDictionaryObject,已在文件的 IndirectObjects 表註冊為間接 PDF 物件。要建構必須以 "N G R" 間接參照序列化的自訂字型 / 色彩 / OCG / Function 字典時,呼叫端可填入回傳的字典,並把它傳給任何接受既有 THPDFDictionaryObject 的 API。這是長期存在的 protected CreateIndirectDictionary 的公開 API 形式

Delphi 語法:

function CreateIndirectFontDict: THPDFDictionaryObject;

 

C++ 語法:

THPDFDictionaryObject* CreateIndirectFontDict();

 

說明

傳回的 dict 初始為空(無 entries)。呼叫端可透過 AddNameValue、AddStringValue、AddNumericValue、AddValue 等加入 entries。dict 由 document 擁有;請勿手動釋放。雖然此方法因主要預期搭配 SetFormUnicodeFontDict 使用而命名為 "FontDict",但傳回的 dict 沒有 font-specific semantics,可保存呼叫端需要的任何 PDF dictionary content

The returned dict starts empty (no entries). The caller adds entries via AddNameValue, AddStringValue, AddNumericValue, AddValue

 

傳回值: 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