Skip to main content

Output Image Size

Version: 1.0

Output Image Size

As it suggests, defining the ImageSize is what specifies the exact size that the output image size will be after the rasterization is completed. Several static ImageSize are defined for quick useof the more common sizes for outputting images. These static ImageSizes and their defined values are as follows:

ceTe.DynamicPDF.Rasterizer.ImageSize.Dpi150

  • Horizontal DPI: 150
  • Vertical DPI: 150

ceTe.DynamicPDF.Rasterizer.ImageSize.Dpi300

  • Horizontal DPI: 300
  • Vertical DPI: 300

ceTe.DynamicPDF.Rasterizer.ImageSize.Dpi600

  • Horizontal DPI: 600
  • Vertical DPI: 600

ceTe.DynamicPDF.Rasterizer.ImageSize.Dpi72

  • Horizontal DPI: 72
  • Vertical DPI: 72

ceTe.DynamicPDF.Rasterizer.ImageSize.Dpi96

  • Horizontal DPI: 96
  • Vertical DPI: 96

ceTe.DynamicPDF.Rasterizer.ImageSize.FaxStandard

  • Horizontal DPI: 204
  • Vertical DPI: 98

ceTe.DynamicPDF.Rasterizer.ImageSize.FaxFine

  • Horizontal DPI: 204
  • Vertical DPI: 196

ceTe.DynamicPDF.Rasterizer.ImageSize.FaxSuperfine

  • Horizontal DPI: 200
  • Vertical DPI: 400

Alternatively to using one of the above static image sizes you can just instantiate any object that inherits from the ImageSize object and use that as one of the arguments to pass into the PdfRasterizer's Draw method. These ImageSize objects and there uses are as follows:

One example of this is demonstrated below. This sample illustrates the syntax that would be needed to rasterize a PDF document into a JPEG that is exactly 200 points in height and 200 points in width. 

PdfRasterizer rasterizer = new PdfRasterizer("C:\\DocumentA.pdf");
FixedImageSize jpegSize = new FixedImageSize(200, 200);
rasterizer.Draw("C:\\DocumentA_Fixed200_Page.jpg", ImageFormat.Jpeg, jpegSize);
Dim MyRasterizer As PdfRasterizer = New PdfRasterizer("C:\DocumentA.pdf")
Dim MyJpegSize As FixedImageSize = New FixedImageSize(200, 200)
MyRasterizer.Draw("C:\Temp\DocumentA_Fixed200_Page.jpg", ImageFormat.Jpeg, MyJpegSize)
Documentation version