Click here to Skip to main content
15,885,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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?
Next
Posted
Comments
syed2109 21-Dec-17 10:50am    
Refer https://forums.asp.net/post/4035790.aspx

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900