简体   繁体   中英

Adding a Table to a pre-existing PDF using iTextSharp/iText

I need to add a table using iTextSharp (or even PDFSharp if it can do it) into an existing PDF template at a particular location in the template. I can edit the existing template with Adobe Designer 7.0. How can I go about doing this? Is there a PlaceHolder analog from Asp.Net which can be used here?

Keith

After some some experimenting, yes, you can do so but with a caveat. First, put a text field down somewhere. In the code, grab the coordinates of where it is. Then build some sort of object to insert there, a table in my case. One caveat is there is no flow, the document will not adjust itself. If your object is too big, it will overwrite (overflow?) what was previously already there. I was hoping for a nice re-flow of what was there, but no dice. I finding that PDFs are a pretty static beast. But I think I'll get it to work for my needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM