3

Does PDFsharp with MigraDoc support HTML syntax?

<a> <strong> etc.

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

BorHunter
  • 893
  • 3
  • 18
  • 44

2 Answers2

4

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,783
  • 17
  • 86
  • 139
Diego Jancic
  • 7,280
  • 7
  • 52
  • 80
1

For example:

para1.AddFormattedText("this text in bold", TextFormat.Bold);
Pang
  • 9,564
  • 146
  • 81
  • 122
phv3773
  • 487
  • 4
  • 10