2
itextsharp allows me to add your PDF elements, example:
_documento.Add(new Paragraph("Olá"));
But I would like to add some elements of HTML such as a <h1>
, or a <p>
, how can I do?
_documento.Add(????);
2
itextsharp allows me to add your PDF elements, example:
_documento.Add(new Paragraph("Olá"));
But I would like to add some elements of HTML such as a <h1>
, or a <p>
, how can I do?
_documento.Add(????);
5
You will need to use a HtmlWorker
:
TextReader reader = new StringReader(html);
HTMLWorker worker = new HTMLWorker(_documento);
_documento.Open();
worker.StartDocument();
worker.Parse(reader);
worker.EndDocument();
worker.Close();
_documento.Close();
Browser other questions tagged c# pdf pdf-generation itextsharp
You are not signed in. Login or sign up in order to post.
I was doing it right then. Only now did I realize that the error was because my html had an image in which src was filled with a Base64 image and not linking to a file. That’s the real problem, I’ll look for a solution and if I don’t find another question.
– Joao Paulo