PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue May 07, 2024 4:48 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jan 29, 2009 5:52 pm 
Offline

Joined: Thu Jan 29, 2009 5:46 pm
Posts: 1
I need to mix different fonts in the same line and hold spacing correctly.

Example,

"I, Joe Blow, have been...."

I need Joe Blow in bold, but I need to hold the spacing correct after the name, no matter what name I have in there. Joe Blow will be populated from a variable, so the size of the name will vary.

Here's my code...
font = New XFont("Arial Narrow", 16, XFontStyle.Regular)
gfx.DrawString("I, ", font, XBrushes.Black, 50, 140)
font = New XFont("Arial Narrow", 16, XFontStyle.Bold)
gfx.DrawString(SQLdr("FirstName") & " " & SQLdr("MI") & ". " & SQLdr("LastName"), font, XBrushes.Black, 65, 140)
font = New XFont("Arial Narrow", 16, XFontStyle.Regular)
gfx.DrawString(" have been...", font, XBrushes.Black, 190, 140)

Please advise.

Thanks,
bsbeck


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 02, 2009 9:25 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3097
Location: Cologne, Germany
I'd use MigraDoc.

I don't know how MigraDoc does it. If you don't want to use MigraDoc, then check the MigraDoc source how it does it.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 107 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