TiffDevice

TiffDevice class

This class helps to save pdf document page by page into the one tiff image.

public sealed class TiffDevice : DocumentDevice

Constructors

Name Description
TiffDevice() Initializes a new instance of the TiffDevice class with default settings.
TiffDevice(PageSize) Initializes a new instance of the TiffDevice class.
TiffDevice(Resolution) Initializes a new instance of the TiffDevice class.
TiffDevice(TiffSettings) Initializes a new instance of the TiffDevice class.
TiffDevice(int, int) Initializes a new instance of the TiffDevice class.
TiffDevice(PageSize, Resolution) Initializes a new instance of the TiffDevice class.
TiffDevice(PageSize, TiffSettings) Initializes a new instance of the TiffDevice class.
TiffDevice(Resolution, TiffSettings) Initializes a new instance of the TiffDevice class.
TiffDevice(TiffSettings, IIndexBitmapConverter) Initializes a new instance of the TiffDevice class.
TiffDevice(int, int, Resolution) Initializes a new instance of the TiffDevice class.
TiffDevice(int, int, TiffSettings) Initializes a new instance of the TiffDevice class.
TiffDevice(PageSize, Resolution, TiffSettings) Initializes a new instance of the TiffDevice class.
TiffDevice(PageSize, TiffSettings, IIndexBitmapConverter) Initializes a new instance of the TiffDevice class.
TiffDevice(Resolution, TiffSettings, IIndexBitmapConverter) Initializes a new instance of the TiffDevice class.
TiffDevice(int, int, Resolution, TiffSettings) Initializes a new instance of the TiffDevice class.
TiffDevice(int, int, TiffSettings, IIndexBitmapConverter) Initializes a new instance of the TiffDevice class.
TiffDevice(PageSize, Resolution, TiffSettings, IIndexBitmapConverter) Initializes a new instance of the TiffDevice class.
TiffDevice(int, int, Resolution, TiffSettings, IIndexBitmapConverter) Initializes a new instance of the TiffDevice class.

Properties

Name Description
FormPresentationMode { get; set; } Gets or sets form presentation mode.
Height { get; } Gets image output height.
RenderingOptions { get; set; } Gets or sets rendering options.
Resolution { get; } Gets image resolution.
Settings { get; } Gets settings for mapping pdf into tiff image.
Width { get; } Gets image output width.

Methods

Name Description
BinarizeBradley(Stream, Stream, double) Do Bradley binarization for input stream.
Process(Document, Stream) Processes the whole document and saves results into stream.
Process(Document, string) Processes the whole document and saves results into file.
override Process(Document, int, int, Stream) Converts certain document pages into tiff and save it in the output stream.
Process(Document, int, int, string) Processes certain pages of the document and saves results into file.

Examples

The following example shows how to convert PDF file to TIFF Images.

[C#]
	// The path to your PDF Directory
	string dataDir = @"YOUR_DATA_DIRECTORY";

	// The file name of the PDF
	string pdfFile = @"YOUR_PDF_FILE";

	// Initialize instance of Document class
	using (Document pdfDocument = new Document(Path.Combine(dataDir, pdfFile)))
	{
		// Create Resolution object 	
		Resolution resolution = new Resolution(300);
		
		// Create TiffSettings object
		TiffSettings tiffSettings = new TiffSettings
		{
			Compression = CompressionType.None,
			Depth = ColorDepth.Default,
			Shape = ShapeType.Landscape,
			SkipBlankPages = false
		};

		// Create TIFF device
		TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);

		// Convert a PDF document to TIFF image
		tiffDevice.Process(pdfDocument, dataDir + "AllPagesToTIFF_out.tif");
	}
[VB.NET]

    ' The path to your PDF Directory
    Dim dataDir As String = "YOUR_DATA_DIRECTORY"
	
    ' The file name of the PDF
    Dim pdfFile As String = "YOUR_PDF_FILE"
 
    ' Initialize instance of Document class 
	Using pdfDocument As Document = New Document(Path.Combine(dataDir, pdfFile))
	
		' Create Resolution object  
		Dim resolution As Resolution = New Resolution(300)
		
		' Create TiffSettings object
		Dim tiffSettings As TiffSettings = New TiffSettings With {
		  .Compression = CompressionType.None,
			.Depth = ColorDepth.[Default],
			.Shape = ShapeType.Landscape,
			.SkipBlankPages = False
		}

		' Create TIFF device
		Dim tiffDevice As TiffDevice = New TiffDevice(resolution, tiffSettings)

		' Convert a PDF document to TIFF image
		tiffDevice.Process(pdfDocument, dataDir & "AllPagesToTIFF_out.tif")

	End Using

See Also