View previous topic :: View next topic |
Author |
Message |
7of42
Joined: 05 Dec 2008 Posts: 2
|
Posted: Fri Dec 05, 2008 11:10 am Post subject: Problems with Printing Tabs and crlf |
|
|
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 |
|
Back to top |
|
|
Soldier-B
Joined: 14 Oct 2008 Posts: 16 Location: USA
|
Posted: Fri Dec 05, 2008 1:57 pm Post subject: |
|
|
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, " "). |
|
Back to top |
|
|
7of42
Joined: 05 Dec 2008 Posts: 2
|
Posted: Fri Dec 19, 2008 9:08 am Post subject: Thanks |
|
|
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. |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Thu Jan 08, 2009 10:01 am Post subject: Re: Thanks |
|
|
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 |
|
Back to top |
|
|
|