cete.dynamicpdf.rasterizer.pdfrasterizerpage
PdfRasterizerPage
- Namespace: ceTe.DynamicPDF.Rasterizer
- Assemblies: DynamicPDF.Rasterizer.dll
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:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v3.X Developer license.
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
- imageFormat: ImageFormat
Represents the image format to use.
- imageSize: ImageSize
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:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v3.X Developer license.
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
- stream: Stream
The Stream containing the Pdf data.
- imageFormat: ImageFormat
Represents the image format to use.
- imageSize: ImageSize
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:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v3.X Developer license.
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
- filePath: String
Physical file path of the image.
- imageFormat: ImageFormat
Represents the image format to use.
- imageSize: ImageSize
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:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v3.X Developer license.
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
- filePath: String
Physical file path of the image.
- imageFormat: ImageFormat
Represents the image format to use.
- imageSize: ImageSize
Represents the image size to use.
- rectangle: RectangleF
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:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v3.X Developer license.
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
- colorFormat: BitmapColorFormat
Represents the color format to use for the Bitmap.
- imageSize: ImageSize
Represents the image size to use.
Returns
Returns a Bitmap contain the image data.
Licensing Info
This method is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v3.X Developer license.
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
- colorFormat: BitmapColorFormat
Represents the color format to use for the Bitmap.
- imageSize: ImageSize
Represents the image size to use.
- antiAliasing: Boolean
Set to false to turn off anti-aliasing.
Returns
Returns a Bitmap contain the image data.
Licensing Info
This method is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v3.X Developer license.
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.
Licensing Info
This method is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v3.X Developer license.
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:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v3.X Developer license.
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:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v3.X Developer license.
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:
- An active DynamicPDF https://www.dynamicpdf.com/ultimate-subscription Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v3.X Developer license.