问题
Does PDFsharp with MigraDoc support HTML syntax?
<a> <strong> etc.
If yes, how can I implement it on the document?
回答1:
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/
回答2:
For example:
para1.AddFormattedText("this text in bold", TextFormat.Bold);
来源:https://stackoverflow.com/questions/20007911/does-pdfsharp-with-migradoc-support-html-syntax