cete.dynamicpdf.rasterizer.pdfrasterizer
PdfRasterizer
- Namespace: ceTe.DynamicPDF.Rasterizer
- Assemblies: ceTe.DynamicPDF.Rasterizer.dll
Represents a PDF rasterizer.
public class PdfRasterizer : IDisposable
Public Class PdfRasterizer
Implements IDisposable
Inheritance: Object → PdfRasterizer
Implements: IDisposable
Licensing
This class is a DynamicPDF Rasterizer feature. The following license is required for non-evaluation usage:
- DynamicPDF Rasterizer for .NET
Examples
This example demonstrates how to rasterize a PDF document.
Imports System
Imports ceTe.DynamicPDF.Rasterizer
Module MyModule
Sub Main()
' Create a PdfRasterizer object.
Dim rasterizer As PdfRasterizer = New PdfRasterizer("InputPdfFile.pdf")
' Save the image.
rasterizer.DrawToMultiPageTiff("Output.tif", TiffImageFormat.TiffWithLzw, ImageSize.Dpi72)
End Sub
End Module
using System;
using ceTe.DynamicPDF.Rasterizer;
class MyClass
{
static void Main(string[] args)
{
// Create a PdfRasterizer object.
PdfRasterizer rasterizer = new PdfRasterizer("InputPdfFile.pdf");
// Save the image.
rasterizer.DrawToMultiPageTiff("Output.tif", TiffImageFormat.TiffWithLzw, ImageSize.Dpi72);
}
}
Constructors
PdfRasterizer(InputPdf)
Initializes a new instance of the PdfRasterizer class.
public PdfRasterizer(InputPdf inputPdf)
Public Sub New (inputPdf As InputPdf)
Parameters
- inputPdf: InputPdf
Represents an input PDF to rasterize.
PdfRasterizer(InputPdf, Int32, Int32)
Initializes a new instance of the PdfRasterizer class.
public PdfRasterizer(InputPdf inputPdf, int startPageNumber, int pageCount)
Public Sub New (inputPdf As InputPdf, startPageNumber As Integer, pageCount As Integer)
Parameters
- inputPdf: InputPdf
Represents an input PDF to rasterize.
- startPageNumber: Int32
Starting page number of the PDF to rasterize.
- pageCount: Int32
Total page count of the PDF to rasterize.
PdfRasterizer(String)
Initializes a new instance of the PdfRasterizer class.
public PdfRasterizer(string filePath)
Public Sub New (filePath As String)
Parameters
- filePath: String
Physical file path of the PDF to rasterize.
PdfRasterizer(String, Int32, Int32)
Initializes a new instance of the PdfRasterizer class.
public PdfRasterizer(string filePath, int startPageNumber, int pageCount)
Public Sub New (filePath As String, startPageNumber As Integer, pageCount As Integer)
Parameters
- filePath: String
Physical file path of the PDF to rasterize.
- startPageNumber: Int32
Starting page number of the PDF to rasterize.
- pageCount: Int32
Total page count of the PDF to rasterize.
Properties
Pages
Gets the PdfRasterizerPageList containing the pages to rasterize.
public PdfRasterizerPageList Pages { get; }
Public Property Pages As PdfRasterizerPageList
Property Value
Methods
AddLicense(String)
Adds a license key.
public static bool AddLicense(string licenseKey)
Shared Function AddLicense(licenseKey As String) As Boolean
Parameters
- licenseKey: String
The license key to add.
Returns
A boolean value indicating if the license is valid.
Remarks
This method accepts a license key, not a serial number.
Append(InputPdf)
Append the entire PDF document to the list of pages to rasterize.
public void Append(InputPdf inputPdf)
Sub Append(inputPdf As InputPdf)
Parameters
- inputPdf: InputPdf
Represents an input PDF to rasterize.
Append(InputPdf, Int32, Int32)
Append the entire the pages of the pdf document to the PdfRasterizerPageList.
public void Append(InputPdf inputPdf, int startPageNumber, int pageCount)
Sub Append(inputPdf As InputPdf, startPageNumber As Integer, pageCount As Integer)
Parameters
- inputPdf: InputPdf
Represents an input PDF to rasterize.
- startPageNumber: Int32
Starting page number of the PDF to rasterize.
- pageCount: Int32
Total page count of the PDF to rasterize.
Append(String)
Append the entire PDF document to the list of pages to rasterize.
public void Append(string filePath)
Sub Append(filePath As String)
Parameters
- filePath: String
Physical file path of the PDF to rasterize.
Append(String, Int32, Int32)
Append the entire PDF document to the list of pages to rasterize.
public void Append(string filePath, int startPageNumber, int pageCount)
Sub Append(filePath As String, startPageNumber As Integer, pageCount As Integer)
Parameters
- filePath: String
Physical file path of the Pdf
- startPageNumber: Int32
Starting page number of the PDF to rasterize.
- pageCount: Int32
Total page count of the PDF to rasterize.
Dispose()
public void Dispose()
Sub Dispose()
Draw(ImageFormat, ImageSize)
Rasterizes all pages in the page list to an array of byte arrays containing the image data.
public Byte[][] Draw(ImageFormat imageFormat, ImageSize imageSize)
Function Draw(imageFormat As ImageFormat, imageSize As ImageSize) As Byte[][]
Parameters
- imageFormat: ImageFormat
Represents the image format to use.
- imageSize: ImageSize
Represents image size to use.
Returns
Returns the array of byte arrays containing the image data.
Draw(String, ImageFormat, ImageSize)
Rasterizes all pages in the page list to an image and stores the image to the given filename.
public void Draw(string fileName, ImageFormat imageFormat, ImageSize imageSize)
Sub Draw(fileName As String, imageFormat As ImageFormat, imageSize As ImageSize)
Parameters
- fileName: String
Physical file path of the image.
- imageFormat: ImageFormat
Represents the image format to use.
- imageSize: ImageSize
Represents image size to use.
DrawToMultiPageTiff(Stream, TiffImageFormat, ImageSize)
Rasterizes all pages in the page list to an multi-page TIFF image and stores it to the given stream.
public void DrawToMultiPageTiff(Stream stream, TiffImageFormat tiffImageFormat, ImageSize imageSize)
Sub DrawToMultiPageTiff(stream As Stream, tiffImageFormat As TiffImageFormat, imageSize As ImageSize)
Parameters
- stream: Stream
Stream containing the Pdf data.
- tiffImageFormat: TiffImageFormat
Represents the TIFF image format to use.
- imageSize: ImageSize
Represents image size to use.
DrawToMultiPageTiff(String, TiffImageFormat, ImageSize)
Rasterizes all pages in the page list to an multi-page TIFF image and stores it to the given filename.
public void DrawToMultiPageTiff(string fileName, TiffImageFormat tiffImageFormat, ImageSize imageSize)
Sub DrawToMultiPageTiff(fileName As String, tiffImageFormat As TiffImageFormat, imageSize As ImageSize)
Parameters
- fileName: String
Physical filepath of the image.
- tiffImageFormat: TiffImageFormat
Represents the TIFF image format to use.
- imageSize: ImageSize
Represents image size to use.
DrawToMultiPageTiff(TiffImageFormat, ImageSize)
Rasterizes all pages in the page list to an multi-page TIFF image and returns it as a byte array.
public Byte[] DrawToMultiPageTiff(TiffImageFormat tiffImageFormat, ImageSize imageSize)
Function DrawToMultiPageTiff(tiffImageFormat As TiffImageFormat, imageSize As ImageSize) As Byte()
Parameters
- tiffImageFormat: TiffImageFormat
Represents the TIFF image format to use.
- imageSize: ImageSize
Represents image size to use.
Returns
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .