Hi,
i have a markdown text with text formating.
What is the best way to add this Markdown to a existing pdf?
The Text insert is after “Test Betreff” in a new line (same page)
Horst21110000001_SIDKC.pdf (77.1 KB)
The Markdwon:
START
Ein Test Text FETT mit KURSIV verschiedenen Unterstrichen Formatierungen
End
INSERTSIGNATURE
@hstumpf
The API does allow you to import HTML text inside your PDF paragraph for any particular page. If that is required, you can consider using following sample code.
public static void TestHTMLMarkdown()
{
var pdfDocument = new Document(path+ "21110000001_SIDKC.pdf");
var page = pdfDocument.Pages[1];//.Add();
string htmlstring1 = "<b>1. </b><div style='margin-top:-20px;margin-left:35px; width: 580px'><b>Blank1 petitions:</b> The Committee will consider the following petitions—<p style=\"margin-left:30px;\">[AY12345] Introduce a law to allow pets in rented and supported accommodation<br />[AY12345] Access to specialist support for hidradenitis suppurativa sufferers in Scotland<br />[AY12345] Change the law to allow adoption for people over the age of 18<br /></p><br><br><br><br><br><br></div>";
HtmlFragment agendaTextHtml = new HtmlFragment(htmlstring1);
page.Paragraphs.Add(agendaTextHtml);
pdfDocument.Save(path + "SavedwithHtml.pdf");//, SaveFormat.Pdf);
}
Hi,
i convert my test markdown to html and add this with your sample to the pdf.
It´s working - thanks for the tip
The convert HTML:
<p>START</p>
<p> </p>
<p>Ein Test Text <strong> FETT</strong> mit <em>KURSIV</em> verschiedenen <u>Unterstrichen</u> Formatierungen</p>
<p> </p>
<p>End</p>
<p> </p>
<p> </p>
<p>INSERTSIGNATURE</p>
@hstumpf
It’s good to know that suggested option has proved to be working on your end.