Click here to Skip to main content
13,087,902 members (78,642 online)
Rate this:
Please Sign up or sign in to vote.
Can you guys help me with dynamically creating pdf docs with itextsharp, while at it, inside the document, create Headers and Footers using images with a loop or something that can help

and also add a side panel/image on the pdf that appears on all pages, this pages are being dynamically generated by either a table or a gridview, I have used a table because I can easily control it unlike the gridview that just prints everything on the pages

My pages created could be from 1 to 8 or 1 to 9 or 1 to 3, the number of pages are unknown, so when I run this for loop below in vb code...the document falls into pieces, You find page repeating itself twice rather than once

For i As Integer = 2 To Len(i)
pdfDoc.Add(Headerpdf) ' this is an image that has to appear on the top of every new page, starting from the second page until the Nth page.

pdfDoc.Add(sidepdf)'' this is an image that has to be printed on the page side of the document, on the left handside of the text, near the text, not under or above it

pdfDoc.Add(table)his is the actuall body, in a table which gets printed to the pdf...most simplest to do that I have so far

pdfDoc.Add(Footerpdf)'this is the footer image of my pdf page, starting from the second page until where the table body page ends, then the following next page(last page) has it's own images
pdfDoc.NewPage() 'this new Page, should I keep it in this loop or remove it?
Posted 27-Sep-12 23:02pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 29 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100