开发者

How can I convert a web form to pdf using itextsharp?

I am trying to convert a web form to a pdf after a user fills in the fields in the web form. Is this possible? All i can do right now is loop through the form collection and print out the field name and the field value to the pdf. Is there a way to do this and keep the pdf looking like the web form?

I'm using mvc 3 for the web page.

Thanks!

Now I am using the following which converts everything in the form but开发者_开发百科 the form fields.

Document doc = new Document();
String path = "C:\\projects\\pdfs\\";
        PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(path + "Doc1.pdf", FileMode.Create));

StringReader sr = new StringReader(htmlString);
HTMLWorker worker = new HTMLWorker(doc);

doc.Open();
worker.Parse(sr);
doc.Close();

How do I get the form fields to display in the pdf?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜