Skip to main content

PdfRasterizerPage

Version: 2.0

cete.dynamicpdf.rasterizer.pdfrasterizerpage

PdfRasterizerPage​

Represents a page of the PDF rasterizer.

public class PdfRasterizerPage : IDisposable
Public Class PdfRasterizerPage
Implements IDisposable

Inheritance: Object → PdfRasterizerPage

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 to one JPEG image for each page.

Imports System
Imports ceTe.DynamicPDF.Rasterizer

Module MyModule

Sub Main()

' Create a PdfRasterizer object.
Dim rasterizer As PdfRasterizer = New PdfRasterizer("InputPdfFile.pdf")

' Create a JpegImageFormat object.
Dim jpegImageFormat As JpegImageFormat = New JpegImageFormat(80)

' Save the image.
Dim i As Integer
For i = 0 To rasterizer.Pages.Count - 1
rasterizer.Pages(i).Draw("Output" + i.ToString() + ".jpg", jpegImageFormat, ImageSize.Dpi72)
Next

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");

// Create a JpegImageFormat object.
JpegImageFormat jpegImageFormat = new JpegImageFormat(80);

// Save the image.
for (int i = 0; i < rasterizer.Pages.Count; i++)
{
rasterizer.Pages[i].Draw("Output"+i+".jpg", jpegImageFormat, ImageSize.Dpi72);
}
}
}

Methods​

Dispose()​

public void Dispose()
Sub Dispose()

Draw(ImageFormat, ImageSize)​

Rasterizes the page to a byte array containing the image data.

public Byte[] Draw(ImageFormat imageFormat, ImageSize imageSize)
Function Draw(imageFormat As ImageFormat, imageSize As ImageSize) As Byte()

Parameters​

Represents the image format to use.

Represents the image size to use.

Returns​

Returns a byte array containing the image data.

Draw(Stream, ImageFormat, ImageSize)​

Rasterizes the page to an image and stores it to the given stream.

public void Draw(Stream stream, ImageFormat imageFormat, ImageSize imageSize)
Sub Draw(stream As Stream, imageFormat As ImageFormat, imageSize As ImageSize)

Parameters​

The Stream containing the Pdf data.

Represents the image format to use.

Represents the image size to use.

Draw(String, ImageFormat, ImageSize)​

Rasterizes the page to an image and stores it to the given file path.

public void Draw(string filePath, ImageFormat imageFormat, ImageSize imageSize)
Sub Draw(filePath As String, imageFormat As ImageFormat, imageSize As ImageSize)

Parameters​

Physical file path of the image.

Represents the image format to use.

Represents the image size to use.

DrawToBitmap(BitmapColorFormat, ImageSize)​

Rasterizes the page and returns it as a Bitmap object containing the image data.

public Bitmap DrawToBitmap(BitmapColorFormat colorFormat, ImageSize imageSize)
Function DrawToBitmap(colorFormat As BitmapColorFormat, imageSize As ImageSize) As Bitmap

Parameters​

Represents the color format to use for the Bitmap.

Represents the image size to use.

Returns​

Returns a Bitmap contain the image data.

DrawToBitmap(BitmapColorFormat, ImageSize, Boolean)​

Rasterizes the page and returns it as a Bitmap object containing the image data.

public Bitmap DrawToBitmap(BitmapColorFormat colorFormat, ImageSize imageSize, bool antiAliasing)
Function DrawToBitmap(colorFormat As BitmapColorFormat, imageSize As ImageSize, antiAliasing As Boolean) As Bitmap

Parameters​

Represents the color format to use for the Bitmap.

Represents the image size to use.

Set to false to turn off anti-aliasing.

Returns​

Returns a Bitmap contain the image data.

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​

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 .

See Also​

ceTe.DynamicPDF.Rasterizer