Hi,
I am trying to convert emf files to pdf using Aspose.Pdf. I am not able to find any samples to do so.
Could you please pass me some?
Thanks,
Kulsum
Hi Kulsum,
//Instantiate a Pdf object by calling
its empty constructor<o:p></o:p>
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
//Create a section in the Pdf object
Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();
//Create an image object in the section
Aspose.Pdf.Generator.Image image1 = new Aspose.Pdf.Generator.Image(sec1);
//Add image object into the Paragraphs collection of the section
sec1.Paragraphs.Add(image1);
//Set the path of image file
image1.ImageInfo.File = "C:/pdftest/test.emf";
//Set the type of image using ImageFileType enumeration
image1.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Emf;
//Set image title
image1.ImageInfo.Title = "EMF image";
//Save the Pdf
pdf1.Save(“c:\pdftest\EMF_test.pdf”);