c# - iTextSharp - Write HTML to pdf document -
I have tried my fearlessness to do this work, but all information about iTextSharp on the web starts dying (I am using version 5.5.3)
I have a simple string variable that has HTML which I want to send to PDF.
There are some examples using XMLWorker / XMLWorkerHelper, but these classes are no longer part of iTextSharp. HTMLWorker is still available, but moans about being obsolete. (And does not even work)
This is what I have done so far:
Public byte [] RenderPdf () {MemoryStream file = New MemoryStream (); Document document = new document (this.PageSize); PdfWriter Author = PdfWriter.GetInstance (document, file); String HTML = GetHTMLFromActionResult (); Document.Open (); // Unavailable code here to inject HTML into the document variable. Document.Close (); Return file Tore (); }
Additional information:
This is a C # MVC5 web application that is running on Net Framework 4.5.2
I see two separate questions in your post:
(1) Where is the XML worker for iTextSharp?
If you want to use XML Worker, you need an additional DLL. I'm not sure if you usually get iTextSharp, but if you go to Sourceforge, then you can clearly see both projects:
Get started with this as well Take that version number corresponds.
(2) Where can I get the documents for XML Worker?
The last time I updated the examples, which was too long till the end of last week, it is not appropriate that they are old, you may not find the official website Found:
I recently added some examples in response to the following questions:
- ...
Of course, examples are iText examples in Java, but if you browse the example, you will get a link A Java example of Tek overflow related questions and many Java those questions about iTextSharp I C # is fairly easy to port.
Comments
Post a Comment