2

Does PDFsharp with MigraDoc support HTML syntax?

<a> <strong> etc.

If yes, how can I implement it on the document?

BorHunter
  • 881
  • 2
  • 18
  • 41

2 Answers2

5

No, it doesn't support HTML directly. You have to write a code that reads the HTML and create the PDF using either MigraDoc or PdfSharp.

To create the PDF, you need to use the API, for instance: .AddPage(...), .Draw(...), .DrawRectangle(...)

You have a full example here.

You can also use this project to convert HTML to PDF: https://wkhtmltopdf.org/

wonea
  • 4,425
  • 17
  • 82
  • 137
Diego Jancic
  • 6,963
  • 7
  • 49
  • 77
1

For example:

para1.AddFormattedText("this text in bold", TextFormat.Bold);
Pang
  • 9,073
  • 146
  • 84
  • 117
phv3773
  • 477
  • 3
  • 10