Class TocGenerator

情報

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

[Obsolete("The class will be deleted soon. Please use PdfManager class.")]
public static class TocGenerator

継承

objectTocGenerator

継承されたメンバー

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

// Create TocOptions object to set instructions
var options = new TocOptions();
// Set the Title
options.Title = "My Table of Contents";
// Design Headings
options.Headings.Add(new TocHeading("Introduction", 2));
options.Headings.Add(new TocHeading("Chapter I", 3));
options.Headings.Add(new TocHeading("Chapter II", 4));
options.Headings.Add(new TocHeading("Chapter III", 5));
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
TocGenerator.Process(options);

この例はブックマークを生成しながら PDF ファイルに目次を追加する方法を示しています。

// Create TocOptions object to set instructions
var options = new TocOptions();
// Set the Title
options.Title = "My Table of Contents";
// Generate links in bookmarks
options.GenerateBookmarks = true;
// Design Headings
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));
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
TocGenerator.Process(options);

この例は PDF ファイルに目次を追加し、ストリームとして保存する方法を示しています。

// Create TocOptions object to set instructions
var options = new TocOptions();
// Set the Title
options.Title = "My Table of Contents";
// Design Headings
options.Headings.Add(new TocHeading("Introduction", 2, false, 1));
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output stream 
var outputStream = new MemoryStream();
options.AddOutput(new StreamData(outputStream));
options.CloseOutputStreams = false;
// Perform the process
TocGenerator.Process(options);

メソッド

Process(TocOptions)

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

public static ResultContainer Process(TocOptions options)

パラメーター

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

戻り値

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

名前空間: Documentize アセンブリ: Documentize.dll

 日本語