0

I trying to display image in pdf when click on print then pdf file is open i try this on button click

     Dim datastram = New StringBuilder("")
        Dim bodystringmain As StringBuilder = New StringBuilder()
        Dim readerstream = New System.IO.StreamReader(Server.MapPath("../Templates/ReportPDF.html"))
        bodystringmain.Append(readerstream.ReadToEnd())
        readerstream.Close()

bodystringmain.Append(datastram)
 bodystring.Append("<img src=""../images/logo_26.jpg""  height=64px width=200px/>")
  bodystringmain.Replace("[Data]", StrBody.ToString)
        Dim con As New Conversions.Html
        con.ConvertHtmlToPdf(Me, bodystringmain, "reort1.pdf", False, True)

and this template reportpdf is

    <html>
<head>
    <title>System</title>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
    <div>
        <p>asdasd</p>
        <img src="../images/01-1.gif" />

    </div>

                             [Data]
</body>
</html>

now when i try to open the file this shows only box no image is display only empty box is display in PDF file

so any solutions?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
user 123
  • 41
  • 2
  • 13

1 Answers1

0

You are expressing your image location as a relative path, meaning that it will only be correct if the present working directory for your process is at the right level relative to the location of your graphic image. (I assume that you are seeing everything else that should be there.)

I would try a fully-defined, specific path to your image and see if that works better.

acg_so
  • 274
  • 1
  • 4