System.UriFormatException:'无效的URI:Uri字符串太长。

时间:2019-06-26 07:07:50

标签: asp.net vb.net

当我将中继器控件内容导出到包含图像的PDF时,出现以下错误:System.UriFormatException:'无效的URI:Uri字符串太长。'

这是错误所指的我的图像。

<img runat="server" id="ImgLogo" src="http://www.lumotech.co.za/images/img_who-we-are_logo.png" class="accordion" style="width:200px;" />

这是代码块:

 Response.ContentType = "application/pdf"
        Response.AddHeader("content-disposition", "attachment;filename=Panel.pdf")
        Response.Cache.SetCacheability(HttpCacheability.NoCache)
        Dim sw As New StringWriter()
        Dim hw As New HtmlTextWriter(sw)
        PanelEmployeeMedicalHistory.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()

0 个答案:

没有答案