Search code examples
htmlvb.netpdfselectpdf

html image to pdf (images not showing) - selectpdf


I am creating pdf files from generated html file by using PdfSelect, the problem is that images are not show on the pdf but is generated on the html.

  Dim converter As New HtmlToPdf()

        ' set converter options
        converter.Options.PdfPageSize = PdfPageSize.A4
        converter.Options.PdfPageOrientation = PdfPageOrientation.Portrait
        ' create a new pdf document converting an url
        Dim doc As SelectPdf.PdfDocument = converter.ConvertUrl(htmlFilePath)

        ' get image path
        Dim imgFile As String = "C:\Users\Stefan\Desktop\Acczone General\statements\leda.jpg"



        ' save pdf document
        doc.Save(pdfFilePath)

        ' close pdf document
        doc.Close()

I tried some coding but it does not work, can someone please help me so that the images show on the pdf?

My html works 100% it is just the pdf, i am using SelectPdf


Solution

  • Use this format:

    Dim imgFile As String = "file:///C:\Users\Stefan\Desktop\Acczone General\statements\leda.jpg"