PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Applying formatting to only a portion of output

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
bressljr



Joined: 06 Dec 2006
Posts: 4

PostPosted: Mon Jan 15, 2007 6:32 pm    Post subject: Applying formatting to only a portion of output Reply with quote

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
View user's profile Send private message
cmgarnett



Joined: 24 May 2007
Posts: 11
Location: Bedford, UK

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

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
View user's profile Send private message
bressljr



Joined: 06 Dec 2006
Posts: 4

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

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 Sad
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Thu May 31, 2007 3:41 pm    Post subject: Re: Did you find an answer Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com