PDFRasterizer.NET 4.0 is now available. Supports .NET Core. Renders pixel-perfectly.

Render PDF to EMF

This code sample helps render PDF to EMF. PDF Rasterizer can also render a PDF page to to an EMF object (Enhanced Metafile). This format is graphical format which is commonly used in .NET applications and in printing.

using (FileStream fs = new FileStream(@"..\..\input.pdf", FileMode.Open, FileAccess.Read))
{
    Document d = new Document(fs);
    Page page = d.Pages[0];

    Metafile metafile = null;

    using (Graphics graphics = this.CreateGraphics())
    {
        System.IntPtr hdc = graphics.GetHdc();
        metafile = new Metafile(hdc, new System.Drawing.RectangleF(0, 0, (float)page.Width, (float)page.Height), MetafileFrameUnit.Point);
        graphics.ReleaseHdc(hdc);
    }

    using (Graphics metafileGraphics = Graphics.FromImage(metafile))
    {
        metafileGraphics.SmoothingMode = SmoothingMode.AntiAlias;
        page.Draw(metafileGraphics);
    }

}
Download PDFRasterizer.NET 3.0
We will send you a download link

  • This field is for validation purposes and should be left unchanged.
Why do we ask your email address?
We send tips that speed up your evaluation
We let you know about bug fixes
You can always unsubscribe with one click
We never share your address with a 3rd party
Thank you for your download

We have sent an email with a download link.