开发者

Could iTextSharp be used to generate PDFs containing the fields in between flowing text

Could iTextSharp be used to generate PDFs containing the fields in between flowing text e.g.

Thankyou for choosing "Pro开发者_高级运维ductNameField". We would ...

I would like to fill the "ProductNameField" from DB using iTextSharp. However the length of the field is not fixed so using form fields leaves the spaces around if the field value is smaller in length or causes overflow if the field value is longer than the space given. I looked in to "floating text field" generated by Adobe LiveCycle but could not find a way to use them from iText.


There's two basic ways to create PDFs with dynamic text:

  1. PDF form fields
  2. Write the PDF manually

The former allows people to fill out PDFs with Adobe Acrobat/Reader but has the limitation that you saw of fixed length fields.

The second option is what iTextSharp is about. You tell iTextSharp to write a paragraph and it does it for you. If you take some static text and combine it with the database or user entered data doesn't really matter, iTextSharp just wants text.

So yes, iTextSharp can do this.

Are you working with an existing PDF or are you creating a PDF from scratch?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜