Joined: 05 Jul 2007
|Posted: Thu Jul 05, 2007 9:50 am Post subject: Formatting a word inside a paragraph text.
Thanks for making a useful tool like PDFSharp.
I am new to PDFsharp and have been using it for last 10-15 days.
In one of my paragraph the string contents are from DB. These string values are to be shown in bold. I have used the following code to generate the pararaph in my PDF.
strPara = "Please submit this form, along with your resume, to the address below. You do not need to include anything else, because you have selected the " + strDeadline_Title + ", you must arrive at our office no later than " + Deadline_Date + " ! This is not a postmark deadline.";
XTextFormatter oPara = new XTextFormatter(gfx);
oPara.Alignment = XParagraphAlignment.Justify;
oPara.DrawString(strPara, font, XBrushes.Black, new XRect(new XPoint(leftMargin, currentY - 10), new XSize(pageWidth - (leftMargin + rightMargin), 40)));
The output of the above code is working fine. But now I need to show the value strDeadline_Title and Deadline_Date in BOLD in the PDF.
Is there anyway that will make these 2 values appear bold in the paragraph and my paragraph appear Justified aligned.
Note : the values from does not have fixed width.
Please reply soon , it urgent ..