PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Jul 14, 2024 10:29 pm

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: Fri Dec 05, 2008 11:10 am 
Offline

Joined: Fri Dec 05, 2008 10:59 am
Posts: 2
Hello,

I have written an website where the user can edit small texts inside an asptextbox. I also enabled the textbox to use the tab-key inside the textbox. Trying to print these texts with pdfsharp I run into two Problems.

1) The crlf is ignored by the drawsting method
oGr.DrawString(sPrintString, fnV9, Brushes.Black, 20, iStart) simply writes one long line of text on the page.
I can solve these problem by spliting the text and print als n-Strings so this is my smaller problem.

2) The bigger problem is, the the size of the tabs is very small in the pdf output. So the print does not look like the text on the Website. I tryed to replace the tabs by spaces ( Chr(160) ) but if I use the messure string method I get a width of 0 for a space.
fsSize = oGr.MeasureString(Chr(160), fnV9, sfFormat)

I would be happy about every tip.

Thanks

7of42


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Dec 05, 2008 1:57 pm 
Offline
User avatar

Joined: Tue Oct 14, 2008 6:15 pm
Posts: 32
Location: USA
The space character is Chr(32) or the string literal " " not Chr(160).

As far as replacing tabs go, I would figure out how many spaces they use up (usually 4 or 5) and use Strings.StrDup(CharCount, " ").


Top
 Profile  
Reply with quote  
 Post subject: Thanks
PostPosted: Fri Dec 19, 2008 9:08 am 
Offline

Joined: Fri Dec 05, 2008 10:59 am
Posts: 2
Hello Soldier-B ,

thanks, for your help. It works now but it works not perfect.

Greetings

7of42

PS I don´t know why but I have not received an email when you answered my question.


Top
 Profile  
Reply with quote  
 Post subject: Re: Thanks
PostPosted: Thu Jan 08, 2009 10:01 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hello!
7of42 wrote:
PS I don´t know why but I have not received an email when you answered my question.

I receive these emails.
You can enable this option for any post. The default setting is in your profile.

Re: Formatting
PDFsharp is low level, MigraDoc is high level.
If you want to deal with Tabs you'd better use MigraDoc. Tabs work similar to those in Word: left, right, decimal, or center alignment, individual positions or default tabs.

_________________
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: Google [Bot] and 23 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:  
cron
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group