PdfRasterizerPage
Represents a page of the PDF rasterizer.
public class PdfRasterizerPage
Public Class PdfRasterizerPage
Inheritance: ObjectPdfRasterizerPage
Licensing Info
This class is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v4.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. |
Draw(Stream, ImageFormat, ImageSize) | Rasterizes the page to an image and stores it to the given stream. |
Draw(String, ImageFormat, ImageSize) | Rasterizes the page to an image and stores it to the given file path. |
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. |
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |