Asked by:
Checkbox in a pdf with iTextSharp

Question
-
User1703251055 posted
Hello ,
How to create checkbox in pdf using iTextsharp. That checbox is placed on table cell. I want around 50 checkbox.
Thursday, July 16, 2015 8:12 AM
All replies
-
User-219423983 posted
Hi shrishail_ashtage,
I have found some similar threads about how to create checkboxes in pdf using iTextSharp, you could take a look. You’d better take a look at the articles that the two threads refer to, they could provide you more things for achieving your need.
http://stackoverflow.com/questions/22186989/add-one-checkbox-with-itextsharp
http://stackoverflow.com/questions/13245208/how-to-create-pdfformfields-using-itextsharp
I hope it’s useful to you.
Best Regards,
Weibo Zhang
Thursday, July 16, 2015 11:01 PM -
User1703251055 posted
Hi Weibo Zhang
Thanks for your reply.
I read your given link. but for 1 or 2 checbox , it is fine . but when we create more than 50 checkbox on pdf it is very diffucult for me to set the checbox position on table cell . Every time i need to calculate the position.
Is there any other way to set position.
When i run the application in browser , the checkbox is displayed . but when i open that file in pdf some checkbox is not displayed.
Is there any reason for that.
Friday, July 17, 2015 1:49 AM -
User366904899 posted
Hello shrishail
You can try with convert html to pdf using itextsharp.
Write down checkbox code in html and convert it into pdf
http://aspnettutorialonline.blogspot.com/2012/04/converting-html-to-pdf-using-itextsharp.html
Friday, July 17, 2015 2:20 AM -
User1703251055 posted
Hello Jayesh
Thanks for reply
Where is checkbox creating code in your link. I want create checkbox control in pdf . There are near about 50 checkbox and that checbox fill in table cell .
Can you give sample example for checbox for that code?
Friday, July 17, 2015 6:09 AM -
User-219423983 posted
Hi shrishail_ashtage,
for 1 or 2 checbox , it is fine . but when we create more than 50 checkbox on pdf it is very diffucult for me to set the checbox position on table cell . Every time i need to calculate the position.
I have found a similar thread you could take a look. In this thread, DaveB provided us a solution about putting a TextBox in a table cell you could refer to and then make some changes to add the checkbox in your project.
http://stackoverflow.com/questions/2675895/itextsharp-text-field-in-pdfpcell
Besides, the following two link maybe helpful to you.
http://www.mikesdotnetting.com/Article/86/itextsharp-introducing-tables
I hope it’s useful to you.
Best Regards,
Weibo Zhang
Monday, July 20, 2015 10:22 PM