I create a new PDF document in my c# project. It have multiple pages with text information. Almost all text information display fine but some of the description field cannot be displayed correctly. It does not show the plain text when my PDF is created. Till now, i cannot figure out why this happens. Does anyone encounter such issue? Does anyone know what I can do?
Thank you so much.
This article on XsPDF.com is what you looking for, check out: Add text to PDF in C#.
Answers
Not sure how much help this will be but it is worth of trying.
You may pass the plain text to PDF functions, neither html nor html snippets. Please note that you should remove the html tags before you pass the string to the DrawString method. And it is up to you whether to separate html tags from PDF plain text.
Thank you for your suggestion and i would like to try it immediately.
One more question, i want to keep all the formatting of the string, so will this work? Let me explain... i want to keep the font size, font color, or text format like bold, underlined, italics, etc. Is this possible?
The parameters passed to DrawString specify how the output looks. The font family, font size, italics, bold, and so on are passed in the font parameter. For example, you may set its output style using XFont, like XFont font = new XFont("Times New Roman", 16, XFontStyle.BoldItalic);