- C# Print document | Code Sample | Tall Components PDF C# samples
- Change colors of black-and-white TIFF after converting from PDF
- Convert multiple PDF pages to bitmap
- Convert PDF to an image using a dither matrix
- Convert PDF to JPG in C#
- Convert PDF to multipage TIFF in C# .NET
- Convert PDF to PNG using WPF
- Convert PDF to XPS
- Convert PDF with layers to image
- Display PDF in a WPF app and stay responsive - the code
- Font mapping
- PDF to grayscale TIFF C#
- C# Print PDF documents from a WPF application
- Render a PDF to bitmap
- Render PDF with ResolveFont event handler
- Render PDF to EMF
- Use multiple licenses
- How to use a system font for rendering text
Convert PDF to JPG in C#
Converter PDF to JPG / PDF to JPEG
This code sample shows how to convert PDF to JPG or JPEG in C#. Download a free trial of PDFRasterizer.NET 3.0 to try the PDF to JPG / PDF to JPEG converter.
static void Main(string[] args)
{
//open the input pdf and select the first page
Document pdfDocument = new Document(new FileStream("input.pdf", FileMode.Open, FileAccess.Read));
Page pdfPage = pdfDocument.Pages[0];
//create a bitmap to draw to and a graphics object
using (Bitmap bitmap = new Bitmap((int)pdfPage.Width, (int)pdfPage.Height))
using (Graphics graphics = Graphics.FromImage(bitmap))
{
//draw the image from the first page to the graphics object, which is connected to the bitmap object
pdfPage.Draw(graphics);
bitmap.Save("out.jpg", ImageFormat.Jpeg);
}
//open the bitmap in the standard application
System.Diagnostics.Process.Start("out.jpg");
}