Class PngConverter

Info

Represents Documentize.PngConverter plugin. Used to convert PDF documents into PNG format.

public static class PngConverter

Inheritance

objectPngConverter

Inherited Members

Examples

The example demonstrates how to convert PDF document into PNG format.

// Create PdfToPngOptions object to set instructions
var options = new PdfToPngOptions();
// Add input File path
options.AddInput(new FileDataSource("path_to_input.pdf"));
// Set output Directory path
options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
// Perform the process
PngConverter.Process(options);

The example demonstrates how to convert 1 page of PDF document into PNG format.

// Create PdfToPngOptions object to set instructions
var options = new PdfToPngOptions()
// Process only the first page
options.PageList = [1];
// Set output resolution to 200 DPI
options.OutputResolution = 200;
// Add input File path
options.AddInput(new FileDataSource("path_to_input.pdf"));
// Set output Directory path
options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
// Perform the process
PngConverter.Process(options);

The example demonstrates how to convert PDF document into PNG format to streams.

// Create PdfToJpegOptions object to set instructions
var options = new PdfToPngOptions();
// Add input File path
options.AddInput(new FileDataSource("path_to_input.pdf"));
// Perform the process
var results = PngConverter.Process(options);
// Get stream results
foreach (var result in results.ResultCollection)
{
    var streamResultPage1 = result.ToStream();
}

Methods

Process(PdfToPngOptions)

Converts PDF document into PNG format.

public static ResultContainer Process(PdfToPngOptions options)

Parameters

  • options PdfToPngOptions: An options object containing instructions for the operation.

Returns

ResultContainer : An object containing the result of the operation.

Exceptions

ArgumentException

If options not set.

Namespace: Documentize Assembly: Documentize.dll

 English