Last post Sep 25, 2018 02:37 AM by Zhi Lv - MSFT
Sep 23, 2018 06:43 PM|dev_dona|LINK
i have a long html form where some html inputs are there like textbox , checkbox and radio button. when converting that form to pdf by itextsharp then textbox , checkbox and radio button etc not printing on pdf form. so please share some sample code that
how to print textbox , checkbox and radio button etc on pdf doc created by itextsharp library.
Sep 23, 2018 11:48 PM|bruce (sqlwork.com)|LINK
Sep 24, 2018 02:09 AM|Zhi Lv - MSFT|LINK
I suggest you could try to use Itext7 's Html2pdf library to achieve your requirement.
Please refer to below codes:
ConverterProperties properties = new ConverterProperties();
//One way you could generated MVC page as html file and use that file path to convert to PDF.
//Another way you coudl read MVC generated html page's steam to convert Page to PDF
HtmlConverter.ConvertToPdf(new FileInfo(""), new FileInfo(""), properties);
Please refer to the following links:
Can I convert an HTML form to a PDF?
Sep 24, 2018 08:24 PM|dev_dona|LINK
can you give me full sample code.
Sep 25, 2018 02:37 AM|Zhi Lv - MSFT|LINK
It is my mistake that in my previous reply I forgot to tell you that the itext only support text files or image files, because, there are three basic things that PDF supports: text, lines/shapes and images. So as for the check box and radio button, I suppose
you could try to draw a image to display them.
How to convert HTML to PDF?
using ITextSharp to create Form files
Besides, here are some related samples about convert html page to pdf, perhaps they can help you.