如何使用iTextSharp将复选框放入pdf中?

时间:2014-05-29 04:15:49

标签: c# asp.net itextsharp

我正在使用iTextSharp将html转换为pdf.But我无法在pdf中提供复选框。请帮助。

Document pdoc = new Document(PageSize.A4, 72, 72, 82, 72);
            MemoryStream ms = new MemoryStream();
            PdfWriter writer = PdfWriter.GetInstance(pdoc, ms);
            pdoc.Open();
            iTextSharp.text.html.simpleparser.HTMLWorker hw =
                         new iTextSharp.text.html.simpleparser.HTMLWorker(pdoc);
            hw.Parse(new StringReader("<input type='checkbox' name='myChkBox' id='myChk'/>"));
           // hw.Parse(new StringReader(myDiv.InnerHtml));
            pdoc.Close();
            Response.AddHeader("Content-Type", "application/pdf");
            Response.AddHeader("Content-Disposition", "attachment;filename=Untitled.pdf");
            Response.OutputStream.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length);
            Response.End();

0 个答案:

没有答案