I'm attempting to add a Gif image to a PDF page, but I can't find an example that shows me how to do this. I create a GifImageData object, but the Draw() method takes a DocumentWriter object and I can't seem to find a way to associate it with a Document. Here's snippet of code.
Document document = new Document();
Page page = new Page(PageSize.Letter, PageOrientation.Portrait, 54.0f);
GifImageData gifImageData = new GifImageData("image.gif");
// How do I instantiate a DocumentWriter and associate it with a document?
//gifImageData.Draw(documentWriter);
document.Pages.Add(page);
document.DrawToWeb("HelloWorld.pdf");
Thanks!
Todd Fisher
Adding a Gif Image to a Document
Re: Adding a Gif Image to a Document
Support · Jul 7, 2008Hello Todd,
You can add the images to the PDF file using our product without any problem. You will have to use the Image page element to add images to the PDF document. You can refer to the Images
topic on our help documentation.
If you are planning to reuse the image you are using then you can use the GifImageData class. This is inherited from the ImageData class and you can refer to the Image Reuse
topic on our help documentation.
Thanks,
ceTe Software Support Team.
Re: Adding a Gif Image to a Document
Forum member · Jul 7, 2008Thanks for the quick reply. I attempted to use the example you referenced to add a new Image object, but it wouldn't compile because the Image class is abstract and can't be instantiated.
Here's the line that failed to compile:
page.Elements.Add( new Image( @"C:\MyLogo.gif", 0, 0 ) );
Re: Adding a Gif Image to a Document
Support · Jul 7, 2008Hello Todd,
You might be using the Image class from .NET or some other namespace. You may have to access our Image class by using its complete namespace. Following is a small sample code for this.
ceTe.DynamicPDF.PageElements.Image image = new ceTe.DynamicPDF.PageElements.Image(@"Path of the image", 0, 0);
page.Elements.Add(image);
Thanks,
ceTe Software Support Team.
Re: Adding a Gif Image to a Document
Forum member · Jul 7, 2008Oh jeez, that was it! Thanks so much!
Todd Fisher