Add superscript and index to pdf via migradoc

I am looking at a function that someone else wrote. The purpose of the function is to read html tags and format html tags appropriately for pdf via MigraDoc

.

This is a function definition.

private Boolean RecursiveFormattedParagraph(Document d, Paragraph para, HtmlNode currentNode, ListInfo listinfo, Boolean listFlag, TextFormat currentFormat) {

It works with tags that the program currently supports (i.e. <b>, <i>

).

How do I add support for subscript

and superscript

? I've done some research and it FormattedText

seems like a suitable method here. But as a beginner C # developer, I'm not really sure how to integrate it into the program.

+3


source to share


1 answer


MigraDoc

has a named element FormattedText

that supports what you are looking for. I don't know how you searched for it, but just a simple google search and I found what you were looking for.

MigraDoc example: Hello MigraDoc is the documentation from MigraDoc. from the example provided by MigraDoc follows:



formattedText = paragraph.AddFormattedText("subscript");
formattedText.Subscript = true;

paragraph.AddText(" or ");

formattedText = paragraph.AddFormattedText("superscript");

formattedText.Superscript = true;

      

+4


source







All Articles