iTextSharp XMLWorkerHelper and Images for HTML to PDF

后端 未结 1 605
暗喜
暗喜 2021-01-20 16:11

Bottom line is I\'m using iTextSharp to write out HTML to a PDF -- with an image. Right now, I\'m at the latest version of iTextSharp which is 5.5.5.0. I ha

1条回答
  •  无人及你
    2021-01-20 16:57

    XML Worker isn't mentioned in the book, because the book was written in 2009 and the development on XML Worker started somewhere in 2011. Your question is very long, yet it is missing an important element: an HTML sample like the one's provided for the sandbox examples (which you don't mention). For instance: when the parse the thoreau.html example using ParseHtmlImagesLinksOops, we lose all images: thoreau_oops.pdf; when we use ParseHtmlImagesLinks, we use an ImageProvider that makes sure we get the correct paths to the images and the result looks quite OK: thoreau.pdf (so do the links, by the way).

    However, when I look at the actual requirement, I see that you want to create a letter with an image for letterhead. In that case, I would use page events to add company stationary to each page. How to do that is explained in the book.

    0 讨论(0)
提交回复
热议问题