itextsharp allows me to add your PDF elements, eg:
_documento.Add(new Paragraph("Olá"));
But I'd like to add some HTML elements, such as <h1>
, or <p>
, how can I do it?
_documento.Add(????);
itextsharp allows me to add your PDF elements, eg:
_documento.Add(new Paragraph("Olá"));
But I'd like to add some HTML elements, such as <h1>
, or <p>
, how can I do it?
_documento.Add(????);
You will need to use HtmlWorker
:
TextReader reader = new StringReader(html);
HTMLWorker worker = new HTMLWorker(_documento);
_documento.Open();
worker.StartDocument();
worker.Parse(reader);
worker.EndDocument();
worker.Close();
_documento.Close();