Class PdfManager

情報

Documentize.PdfManagerプラグインを表します。PDFドキュメントをマージ、分割、最適化、回転、サイズ変更、圧縮し、テーブルや目次をPDFドキュメントに追加するために使用されます。複数のPDFドキュメントを1つのPDFにマージできます。PDFドキュメントを個別のページに分割できます。PDFドキュメントを最適化、回転、サイズ変更、圧縮できます。PDFドキュメントのページを回転、サイズ変更できます。PDFドキュメントにテーブルを追加できます。PDFドキュメントに目次を追加できます。

Documentize.PdfManagerプラグインを表します。PDFドキュメントをマージ、分割、最適化、回転、サイズ変更、圧縮し、テーブルや目次をPDFドキュメントに追加するために使用されます。 複数のPDFドキュメントを1つのPDFにマージできます。 PDFドキュメントを個別のページに分割できます。 PDFドキュメントを最適化、回転、サイズ変更、圧縮できます。 PDFドキュメントのページを回転、サイズ変更できます。 PDFドキュメントにテーブルを追加できます。 PDFドキュメントに目次を追加できます。

public static class PdfManager

Inheritance

objectPdfManager

Inherited Members

Examples

The example demonstrates how to Merge two PDF documents.

// Create MergeOptions object to set instructions
var options = new MergeOptions();
// Add input file paths
options.AddInput(new FileDataSource("path_to_your_pdf_file_1.pdf"));
options.AddInput(new FileDataSource("path_to_your_pdf_file_2.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.Merge(options);

The example demonstrates how to Split PDF document.

// Create SplitOptions object to set instructions
var options = new SplitOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file paths
options.AddOutput(new FileDataSource("path_to_result_pdf_file_1.pdf"));
options.AddOutput(new FileDataSource("path_to_result_pdf_file_2.pdf"));
// Perform the process
PdfManager.Split(options);

The example demonstrates how to Optimize PDF document.

// Create OptimizeOptions object to set instructions
var options = new OptimizeOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.Optimize(options);

The example demonstrates how to Rotate PDF document.

// Create RotateOptions object to set instructions
var options = new RotateOptions();
// Set new Rotation
options.Rotation = Rotation.On90;
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.Rotate(options);

The example demonstrates how to Resize PDF document.

// Create ResizeOptions object to set instructions
var options = new ResizeOptions();
// Set new PageSize
options.PageSize = PageSize.A3;
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.Resize(options);

The example demonstrates how to Compress PDF document.

// Create CompressOptions object to set instructions
var options = new CompressOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.Compress(options);

The example demonstrates how to Add Table to PDF file.

// Configure table options
var options = new TableOptions().InsertPageBefore(1)
   .AddTable()
        .AddRow()
            .AddCell().AddParagraph("Name")
            .AddCell().AddParagraph("Age")
        .AddRow()
            .AddCell().AddParagraph("Bob")
            .AddCell().AddParagraph("12")
        .AddRow()
            .AddCell().AddParagraph("Sam")
            .AddCell().AddParagraph("20")
        .AddRow()
            .AddCell().AddParagraph("Sandy")
            .AddCell().AddParagraph("26")
        .AddRow()
            .AddCell().AddParagraph("Tom")
            .AddCell().AddParagraph("12")
        .AddRow()
            .AddCell().AddParagraph("Jim")
            .AddCell().AddParagraph("27");
// Add input file path
options.AddInput(new FileDataSource("path_to_input.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_output.pdf"));
// Perform the process
PdfManager.AddTable(options);

The example demonstrates how to add Table of Contents to PDF file.

// 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 FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.AddTableOfContents(options);

The example demonstrates how to add Table of Contents to PDF file with generating bookmarks.

// 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 FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.AddTableOfContents(options);

The example demonstrates how to add Table of Contents to PDF file and save as stream.

// 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 FileDataSource("path_to_your_pdf_file.pdf"));
// Set output stream 
var outputStream = new MemoryStream();
options.AddOutput(new StreamDataSource(outputStream));
options.CloseOutputStreams = false;
// Perform the process
PdfManager.AddTableOfContents(options);

Methods

AddTable(TableOptions)

PDFドキュメントにテーブルを追加します。

public static ResultContainer AddTable(TableOptions options)

Parameters

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

Returns

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

Exceptions

ArgumentException

オプションが設定されていない場合。

AddTableOfContents(TocOptions)

PDFドキュメントに目次(TOC)を追加します。

public static ResultContainer AddTableOfContents(TocOptions options)

Parameters

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

Returns

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

Exceptions

ArgumentException

オプションが設定されていない場合。

Compress(CompressOptions)

PDFドキュメントを圧縮します。ドキュメントのサイズを減らすことを試みます。

public static ResultContainer Compress(CompressOptions options)

Parameters

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

Returns

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

Exceptions

ArgumentException

オプションが設定されていない場合。

Merge(MergeOptions)

PDFドキュメントをマージします。

public static ResultContainer Merge(MergeOptions options)

Parameters

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

Returns

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

Exceptions

ArgumentException

オプションが設定されていない場合。

Optimize(OptimizeOptions)

PDFドキュメントを最適化します。 ドキュメントをリニアライズして

  • できるだけ早く最初のページを開くことができるようにします。
  • 次のページまたはリンクをクリックして次のページをできるだけ早く表示します。
  • データが遅いチャネルで届くとき、ページを受け取っている間にページを段階的に表示できるようにします(最も役に立つデータから表示);
  • ユーザーがリンクをたどるなどの操作を、ページ全体が受信されて表示される前に実行できるようにします。
public static ResultContainer Optimize(OptimizeOptions options)

Parameters

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

Returns

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

Exceptions

ArgumentException

オプションが設定されていない場合。

Resize(ResizeOptions)

PDFドキュメントのページをサイズ変更します。

public static ResultContainer Resize(ResizeOptions options)

Parameters

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

Returns

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

Exceptions

ArgumentException

オプションが設定されていない場合。

Rotate(RotateOptions)

PDFドキュメントのページを回転させます。

public static ResultContainer Rotate(RotateOptions options)

Parameters

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

Returns

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

Exceptions

ArgumentException

オプションが設定されていない場合。

Split(SplitOptions)

PDFドキュメントをページごとに分割します。

public static ResultContainer Split(SplitOptions options)

Parameters

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

Returns

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

Exceptions

ArgumentException

オプションが設定されていない場合。

Namespace: Documentize Assembly: Documentize.dll

 日本語