Skip to main content

PdfRasterizerPage

Version: 4.0

cete.dynamicpdf.rasterizer.pdfrasterizerpage

PdfRasterizerPage​

Represents a page of the PDF rasterizer.

public class PdfRasterizerPage
Public Class PdfRasterizerPage

Inheritance: Object → PdfRasterizerPage

Licensing Info​

This class is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:

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)

' Create a rectangle for cropping a page
Dim rectangle As New RectangleF(New PointF(10F, 10F), New SizeF(100F, 100F))

' 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)
rasterizer.Pages(i).Draw("OutputCropped"+i.ToString()+".jpg", jpegImageFormat, ImageSize.Dpi72,rectangle)
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);

// Create a rectangle for cropping a page
System.Drawing.RectangleF rectangle = new System.Drawing.RectangleF(new PointF(10.0F, 10.0F),new SizeF(100.0F, 100.0F));

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

rasterizer.Pages[i].Draw("OutputCropped"+i+".jpg", jpegImageFormat, ImageSize.Dpi72,rectangle);
}
}
}

Methods​

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.

Licensing Info​

This method is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:

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 to which image will be written.

Represents the image format to use.

Represents the image size to use.

Licensing Info​

This method is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:

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.

Licensing Info​

This method is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:

Draw(String, ImageFormat, ImageSize, RectangleF)​

Rasterizes the page to a Cropped image according to the given Dimensions and stores it to the given file path.

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

Parameters​

Physical file path of the image.

Represents the image format to use.

Represents the image size to use.

Represents the cropped rectangular area of the page.

Licensing Info​

This method is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:

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.

Licensing Info​

This method is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:

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 .

Licensing Info​

This method is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:

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.

Licensing Info​

This method is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:

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 .

Licensing Info​

This method is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:

See Also​

ceTe.DynamicPDF.Rasterizer