Class TocGenerator

情報

Documentize.TocGenerator プラグインを表します。PDF ドキュメントに目次を追加するために使用されます。

public static class TocGenerator

継承

objectTocGenerator

継承メンバー

この例は、PDF ファイルに目次を追加する方法を示します。

// TocOptions オブジェクトを作成して指示を設定
var options = new TocOptions();
// タイトルを設定
options.Title = "My Table of Contents";
// ブックマークのリンクを生成
options.GenerateBookmarks = true;
// 見出しをデザイン
options.Headings.Add(new TocHeading("Introduction", 2, false, 1));
options.Headings.Add(new TocHeading("Chapter I", 3, true, 1));
options.Headings.Add(new TocHeading("Chapter II", 4, true, 1));
options.Headings.Add(new TocHeading("Example A", 4, true, 2));
options.Headings.Add(new TocHeading("Example B", 4, true, 2));
options.Headings.Add(new TocHeading("Example C", 4, true, 2));
options.Headings.Add(new TocHeading("Example D", 4, true, 2));
options.Headings.Add(new TocHeading("Chapter III", 5, true, 1));
// 入力ファイルパスを追加
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// 出力ファイルパスを設定
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// 処理を実行
TocGenerator.Process(options);

メソッド

Process(TocOptions)

指定されたパラメータを使用して Documentize.TocGenerator の処理を開始します。

public static ResultContainer Process(TocOptions options)

パラメータ

  • options TocOptions: 操作の指示を含むオプション オブジェクト。

戻り値

ResultContainer: 操作の結果を含む Documentize.ResultContainer オブジェクト。

Namespace: Documentize Assembly: Documentize.dll

 日本語