PNG to PDF

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v5)  /  PNG to PDF

DynamicPDF CoreSuite for .NET (v5) Forum

 Feb 17 2011 5:37 PM
I currently use code that converts a TIFF to PDF as shown below.  I need to be able to convert a PNG to a PDF as well, but haven't the first clue where to start b/c it doesn't work the same way.

Thanks!

Dim TiffFile As ceTe.DynamicPDF.Imaging.TiffFile = New ceTe.DynamicPDF.Imaging.TiffFile(ImagePath)

Dim document As ceTe.DynamicPDF.Document = TiffFile.GetDocument()
document.Draw(DestFilePath)
 Feb 18 2011 8:37 AM
Posted by a ceTe Software moderator
Hello,

Yes, you can add PNG images to the PDF document without any problem using our DynamicPDF Generator product. You will have to use the Image page element to do this. Please refer the documentation on Image page element at: http://www.DynamicPDF.com/Support/NET_Help_Library_11_01/ceTe.DynamicPDF~ceTe.DynamicPDF.PageElements.Image.html. Also below is the sample code for it.

            Document doc = new Document();
            Page page = new Page();
            Image image = new Image((@"C:\temp\Test.png", 0, 0, 1.0F);
            page.Elements.Add(image);
            doc.Pages.Add(page);
            doc.Draw(@"C:\temp\MyDocument.pdf");

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 5:20 AM.