using System; using PDFjet.NET; /** * Example_03.cs * */ public class Example_03 { public Example_03() { PDF pdf = new PDF(); Font f1 = new Font(pdf, "Helvetica"); Image image1 = new Image(pdf, "images/eu-map.png"); Image image2 = new Image(pdf, "images/fruit.jpg"); Image image3 = new Image(pdf, "images/mt-map.gif"); Page page = new Page(pdf, A4.PORTRAIT); TextLine text = new TextLine(f1, "The map below is an embedded PNG image"); text.SetPosition(90.0, 30.0); text.DrawOn(page); image1.SetPosition(90, 40); image1.DrawOn(page); text.SetText( "JPG image file embedded once and drawn 3 times"); text.SetPosition(90.0, 550); text.DrawOn(page); image2.SetPosition(90, 560); image2.ScaleBy(0.5); image2.DrawOn(page); image2.SetPosition(260, 560); image2.ScaleBy(0.5); image2.DrawOn(page); image2.SetPosition(350, 560); image2.ScaleBy(0.5); image2.DrawOn(page); text.SetText( "The map on the right is an embedded GIF image"); text.SetPosition(90.0, 800); text.DrawOn(page); image3.SetPosition(390, 630); image3.ScaleBy(0.5); image3.DrawOn(page); pdf.Wrap(); pdf.Save("Example_03.pdf"); } public static void Main(String[] args) { try { new Example_03(); } catch (Exception e) { Console.WriteLine(e.StackTrace); } } } // End of Example_03.cs