How can I use iText to convert HTML with images and hyperlinks to PDF?

前端 未结 2 1307
忘了有多久
忘了有多久 2020-12-11 07:06

I\'m trying to convert HTML to PDF using iTextSharp in an ASP.NET web application that uses both MVC, and web forms.

2条回答
  •  长情又很酷
    2020-12-11 07:20

    Very helpful post,

    I was problem to render images in my report html to pdf. with your post I could do it.

    I'm working with asp.mvc 5.

    I only have to change this method of the ImageProviderClass

    public virtual string GetImageRootPath() { return null; }
    

    to

    public virtual string GetImageRootPath() { HostingEnvironment.MapPath("~/Content/Images/") }
    

    thanks!

提交回复
热议问题