- DocImaging for C#
- DocImaging for VB.NET
- SDK Class API Reference
Guide for C#
Core Document Formats
If this is your first time to use our DocImageSDK, we strongly suggest you reading How to Start first!
PDF Rendering to Raster Images in C#
RasterEdge.com provides C# developers with mature PDF document processing and rendering library. Integrate with .NET Image Core DLLs, users may easily render and convert PDF document to raster images.
Using our C#.NET PDF Document Add-On, you can render target PDF document to Bmp image format through C# programming. Bmp is a device-independent raster image file format which can be used to store 2D digital images. As a raster image, Bmp file is built pixel by pixel and it can be easily edited. Generally, the color of individual pixel can be changed.
Our C#.NET PDF Doc Add-On supports simple PDF to Gif conversion using C# code. Gif is abbreviated from Graphics Interchange Format and compressed using the lossless data compression technology. Therefore, Gif images are of small file size while preserving the visual quality. In our daily life, we can see many logos in Gif format.
If you want to convert your PDF document to Jpeg file, you may use this advanced PDF Document Add-On for C#.NET. Jpeg is short for Joint Photographic Experts Group. Due to its small size property, Jpeg images are often used on web sites or in E-mails. When the Jpeg image is compressed and saved, its image quality will maintain the same.
It is easy to convert & render PDF document to Png (Portable Network Graphics) in C#.NET by using our .NET PDF Doc Conversion Add-On. Png file has the ability to integrate low-resolution images with fast loading speed. It is the most widely used lossless-compression raster graphics on the Internet.
In this part, you will see navigation for this C# PDF rendering to raster images guide page. For C# PDF-to-Tiff rendering, please see online guide: Convert & Render PDF to TIFF in C#.NET.
Functions for PDF to Raster Images in C#
Convert PDF to Raster Images Collection with C# APIs
C# programmers can convert PDF document to raster images collection. And this is a bulk operation with customized options.
void ConvertToImages(ImageType targetType, int resolution, String directory, String fileName);
These methods will automatically convert every page in PDF document to raster image files, with the page index append to fileName. Note that, the resolution is default to be 96 dpi for monitor displaying purpose. C#.NET users can adjust resolution to enlarge or reduce the size of image file or specify the zoomValue to adjust image size. Meanwhile, the original image size can be obtained with zoomValue set to be 1.
Convert PDF Page to Image File with C# APIs
To get full control over C#.NET PDF rendering process, you can work with PDFPage object. First, get specific PDFPage object from PDF document by BasePage GetPage(int index), and then you can render PDFPage object to REImage or other raster image formats with customized parameters. And below are related APIs.
REImage CropImage(Rectangle sourceRegion, Size targetSize);
If you want to zoom in the page with a large factor, say 8x and paint the whole page. This will cost not only a very high usage of memory resource but also a considerable amount of time to proceed. The common practice is to show part of the page with a zoom in factor at a time. And CropImage API is designed for this purpose.
Convert PDF Page to Bitmap with C# APIs
In .NET Framework, Bitmap is a very common class in image processing. RasterEdge .NET PDF Add-on DLL provides C# developers with APIs to directly convert PDFPage to Bitmap object which then can be drew on graphics of (for example) WinForms control.
Please note, C#.NET APIs returning a Bitmap object are faster than return a REImage object, so you may use it for application that requires a high speed performance.
C# Demo Codes for PDF to Raster Images
We offer free C# sample code online for you to convert PDF document to raster images (Bmp, Gif, Jpeg, Png).
// load PDF document