Home

Bytescout.PDF for .NET



Bytescout.PDF library for .NET - EMF to PDF conversion

Download Free Trial Buy Now More Information
For HTML2PDF and XML2PDF solution check our PDFDoc Scout ActiveX library instead

Converting EMF into PDF document

This example demonstrates how to convert EMF into PDF using Bytescout.PDF library

IMPORTANT: for more advanced EMF to PDF conversion support (including enhanced support for EMF produced by virtual printers etc) please see PDFDoc Scout ActiveX library instead. Registered users of Bytescout.PDF can get 50% off for PDFDoc Scout ActiveX

metafile converted into PDF using Bytescout.PDF for .NET

Download example source code: bytescoutpdf_metafile_emf_to_pdf.zip (10 KB)

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Bytescout.PDF;
using System.Drawing.Imaging;


namespace MetafileSample
{
class Program
{
static void Main(string[] args)
{
// Create main PDF Doc Engine
PDFDocEngine engine = new PDFDocEngine("demo", "demo");

// Add new document
Document document = engine.AddDocument();

// create and load metafile
Metafile mf = new Metafile("SampleMetafile.emf");

// Append new page to the document
Page page = document.AddPage(PageSizeType.A3, PageOrientationType.LandScape);

// Create new drawing
Drawing drawing = page.AddDrawing();

// Show images
drawing.PlayMetaFile(mf.GetHenhmetafile(), 0, 0, 1, 1);

// Closing drawing on the page
drawing.Close();

// Save document
document.Save("Metafile.pdf");

// open generated PDF document in default PDF viewer installed in Windows
Process.Start("Metafile.pdf");
}
}
}

Download example source code: bytescoutpdf_metafile_emf_to_pdf.zip (10 KB)

Download Free Trial Buy Now More Information
For HTML2PDF and XML2PDF solution check our PDFDoc Scout ActiveX library instead

"Hello, World!" quick start step-by-step tutorials:

Advanced Examples:
Products  |  Download  |  Purchase  |  Support  |  Contacts  |  Testimonials  |  News |  

ByteScout, 2003-2008. All other company and product names may be trademarks of their respective companies. Privacy Statement