cete.dynamicpdf.rasterizer.pdfrasterizerpage
PdfRasterizerPage
- Namespace: ceTe.DynamicPDF.Rasterizer
- Assemblies: ceTe.DynamicPDF.Rasterizer.dll
Represents a page of the PDF rasterizer.
public class PdfRasterizerPage
Public Class PdfRasterizerPage
Inheritance: Object → PdfRasterizerPage
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
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.
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.
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.
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.
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 isAntiAliasing)
Function DrawToBitmap(colorFormat As BitmapColorFormat, imageSize As ImageSize, isAntiAliasing As Boolean) As Bitmap
Parameters
- colorFormat: BitmapColorFormat
Represents the color format to use for the Bitmap.
- imageSize: ImageSize
Represents the image size to use.
- isAntiAliasing: Boolean
Set false if anti-aliasing to be turned off.
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
- 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 .