insert pic in merger

insert pic in merger

Forum member · Nov 22, 2006
hello, how could i insert a pic in the merger document? and one more thing, how could i create a merger from stream, i'm now using PdfDocument to do so: using (Stream stream = this.GetType().Assembly.GetManifestResourceStream("somedoc.pdf")) { PdfDocument pd = null; pd = new PdfDocument(stream); MergeDocument d; d = new MergeDocument(pd); } does this mean I have to buy both generator and merger? many thanks.

Re: insert pic in merger

Support · Nov 22, 2006
Hello, You can add images to existing PDF documents without any problem. Please refer to the Images topic in our help documentation to add images and refer to the Adding new Contents to the existing page topic to add new contents to an existing page. In order to create a PDF document from a stream you will have to use the PdfDocument object and the MergeDocument object which takes the PdfDocument object as a parameter in its constructor. You do not have to buy both Generator and Merger, a Merger product includes a Generator in it. So buying a Merger is enough. Thanks, ceTe Software Support Team.

Re: insert pic in merger

Forum member · Nov 22, 2006
thank you for your prompt reply. I wanted open a pdf document, fill in the forms, insert some pics and save the document. Now in my understanding, I will have to: 1. Create PdfDocument from filepath 2. Create MergeDocument form that PdfDocument 3. Fill in the forms 4. Draw the MergeDocument to file 5. Create ImportedPage from that saved file 6. Add Image elegment to that ImportedPage 7. Create a brand new Document 8. Add Imported page to that new Document 9. Draw Document to file right? that's so awkard, what if the existing document have 2 pages? what a load? Can you help me on this?

Re: insert pic in merger

Forum member · Nov 22, 2006
that filepath above means the embedded stream's path, FYI many thanks

Re: insert pic in merger

Support · Nov 22, 2006
Hello, In order to add images and to do form filling you do not have to do all these steps. Please refer to the folloing code which helps you to add an image to an existing Pdf document. PdfDocument pdfDoc = new PdfDocument(stream); // If you use a stream as input. MergeDocument document = new MergeDocument(pdfDoc); document.Pages[0].Elements.Add( new Image( @"D:\Temp\Berries.jpg", 0, 0, 1 ) ); document.Draw( @"D:\MyDocument.pdf" ); You can access the second page with document.Pages[1], you can access any page to add new contents to that page. Thanks, ceTe Software Support Team.