iTextSharp不生成PDF格式的表格边框

时间:2016-02-13 05:53:55

标签: asp.net vb.net pdf-generation itextsharp

我正在使用iTextSharp生成PDF文件,但边框未显示在我的PDF文件中。如何使用PDF生成边框

生成pdf的代码:

Private Sub GeneratePDFReport(repeaterName As Repeater)
        Response.ContentType = "application/pdf"
        Response.AddHeader("content-disposition", "attachment;filename=Vasundhara.pdf")
        Response.Cache.SetCacheability(HttpCacheability.NoCache)
        Dim sw As New StringWriter()
        Dim hw As New HtmlTextWriter(sw)
        repeaterName.RenderControl(hw)
        Dim sr As New StringReader(sw.ToString())
        Dim pdfDoc As New Document(PageSize.A4, 10.0F, 10.0F, 100.0F, 0.0F)
        Dim htmlparser As New HTMLWorker(pdfDoc)
        PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
        pdfDoc.Open()
        htmlparser.Parse(sr)
        pdfDoc.Close()
        Response.Write(pdfDoc)
        Response.[End]()
    End Sub

任何人都可以帮助我。如何在PDF文件中显示边框 我的PDF屏幕截图附有此帖子enter image description here

1 个答案:

答案 0 :(得分:0)

将此代码添加到按钮单击。

get-pizza
相关问题