Save Vector Content To JPEG

PDF JPG Format Conversion Rasterization

Reads vector content from the specified PDF file, rasterizes it, and saves it in JPEG format.

Сode Snippet

using (var reader = new PdfReader("GraphicsContainer.pdf"))
using (var gc = reader.Frames[0].GetContent())
using (var writer = new JpegWriter("GraphicsContainer.jpg"))
using (var ig = new ImageGenerator(gc, PixelFormat.Format24bppRgb, RgbColor.White))
{
    Pipeline.Run(ig + writer);
}

Input

GraphicsContainer.pdf

Download

Output

GraphicsContainer.jpg

For AI-assisted development: Download Graphics Mill Code Samples XML Catalog