View previous topic :: View next topic |
Author |
Message |
bressljr
Joined: 06 Dec 2006 Posts: 4
|
Posted: Mon Jan 15, 2007 6:32 pm Post subject: Applying formatting to only a portion of output |
|
|
Hello. Is there a way to apply formatting to only a select portion of the string that is being fed through the Drawstring method? In other words, if I have the following sentence:
"You hae selected Product X which contains...blah, blah, blah"
If I wanted to put a gray background behind "Product X", is there some way that I can do that without breaking the sentence up into separate strings?
Thanks |
|
Back to top |
|
|
cmgarnett
Joined: 24 May 2007 Posts: 11 Location: Bedford, UK
|
Posted: Thu May 31, 2007 8:45 am Post subject: Did you find an answer |
|
|
Hi
I have to do something similar in that I want to embed one or two emboldened words into a sentence. Did you ever find an answer?
Cheers. |
|
Back to top |
|
|
bressljr
Joined: 06 Dec 2006 Posts: 4
|
Posted: Thu May 31, 2007 3:17 pm Post subject: Reply |
|
|
I never found the answer and ended up switching my solution to use ITextSharp instead. Not saying that there wasn't a solution with PDFSharp, I just was up against a deadline and happened to find out how to do it with Itext, so went that route. Sorry |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Thu May 31, 2007 3:41 pm Post subject: Re: Did you find an answer |
|
|
Hi!
cmgarnett wrote: | I have to do something similar in that I want to embed one or two emboldened words into a sentence. Did you ever find an answer? |
I can't tell you how to do it with PDFsharp (but it surely can be done).
We normally use MigraDoc for rich formatted texts.
Code: | FormattedText ft = paragraph.AddFormattedText("foo", TextFormat.Bold);
ft.Font.Size = 6;
|
Some attributes can be set with AddFormattedText directly, all can be set through the FormattedText object you get. _________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
|