PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 20, 2024 7:09 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Jan 15, 2007 6:32 pm 
Offline

Joined: Wed Dec 06, 2006 11:32 am
Posts: 4
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


Top
 Profile  
Reply with quote  
 Post subject: Did you find an answer
PostPosted: Thu May 31, 2007 8:45 am 
Offline

Joined: Thu May 24, 2007 10:20 pm
Posts: 11
Location: Bedford, UK
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.


Top
 Profile  
Reply with quote  
 Post subject: Reply
PostPosted: Thu May 31, 2007 3:17 pm 
Offline

Joined: Wed Dec 06, 2006 11:32 am
Posts: 4
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 :(


Top
 Profile  
Reply with quote  
PostPosted: Thu May 31, 2007 3:41 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 114 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group