Last post Jul 02, 2010 12:59 AM by santosh.aitha
Jul 01, 2010 06:47 AM|santosh.aitha|LINK
I would like to represent a subscript of 2.
Eg: for representing Carbondioxide CO2 using C# and display on a web browser.
Jul 01, 2010 07:44 AM|Mikesdotnetting|LINK
Jul 01, 2010 07:51 AM|santosh.aitha|LINK
Thanks for your reply
Actually i am using iTextSharp to generate a dynamic pdf using C#.
In the process of generating the pdf i need to display CO2 using C# code not html.
Just to display on the browser i am using <sub> tags which works fine, but i would like to replicate the same using C# code while dynamically generating the pdf.
I could get the superscript using the character map for the system tools, i could not find any for subscript (2).
Please let me know how to achieve this using C# code.
Jul 01, 2010 07:53 AM|santosh.aitha|LINK
I have gone through your tutorials of using iTextSharp... they are very nice and very useful.
But if you can add how to represent SubScript using C# and iTextSharp, that would be really great..
Jul 01, 2010 08:20 AM|Mikesdotnetting|LINK
With iTextSharp, you use Font.SetTextRise to get super and subscripts:
doc1.Add(new Chunk("Carbondioxide CO"));
doc1.Add(new Chunk("2", FontFactory.GetFont(FontFactory.HELVETICA, 6)).SetTextRise(-2));
Jul 02, 2010 12:59 AM|santosh.aitha|LINK
Its wonderful... it fixed my issue.