PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 8:36 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: Wed Oct 09, 2019 5:48 am 
Offline

Joined: Wed Oct 09, 2019 4:49 am
Posts: 2
Hi ,

Currently i am using pdfSharp for creating table structure
I am using
XTextFormatter.Alignment = XParagraphAlignment.Left;
XTextFormatter.DrawString(text, XFont, XBrushes.Black, rect, XStringFormats.TopLeft);
rect has the calculated value of height and width

Now issue is "more space is added beween words for all the columns"
what could be the issue here?

Note: I am using private Fonts

please refere attached screenshot.
Thanks


Attachments:
space.png
space.png [ 2.95 KiB | Viewed 8027 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 09, 2019 8:28 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!
NAGG123 wrote:
Note: I am using private Fonts
Not repro.
See also:
http://forum.pdfsharp.net/viewtopic.php?f=2&t=832

Maybe a different font is used for measuring and for drawing. This would explain the big spaces.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 04, 2019 9:14 am 
Offline

Joined: Wed Oct 09, 2019 4:49 am
Posts: 2
Thanks Thomas for your response.

But I dont see any space issue when i use below code with my custom fonts (refer attached image)
XGraphics.DrawString(Text, Font, XBrushes.Black, X, Y, XStringFormats.CenterLeft);

Just to crosscheck on Font, i tried using Arial font instead of my custom font
but i still see same space issue with Arial Font style when it is used with XTextFormatter.DrawString()


What could be the issue here?
Thanks


Attachments:
no_space.png
no_space.png [ 2.82 KiB | Viewed 8005 times ]
space2.png
space2.png [ 3.59 KiB | Viewed 8012 times ]
Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 04, 2019 9:36 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
NAGG123 wrote:
What could be the issue here?
Maybe a different font is used for measuring and for drawing. This would explain the big spaces.

_________________
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 126 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