Print Page | Close Window

Spaces in DrawTextBox not displayed in pdf

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1288
Printed Date: 29 Apr 25 at 4:45PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Spaces in DrawTextBox not displayed in pdf
Posted By: stakon
Subject: Spaces in DrawTextBox not displayed in pdf
Date Posted: 07 Dec 09 at 9:41AM
Good day,

I have noticed that when writing in a pdf file using DrawTextBox . any spaces in the string provided are truncated.
For example when calling: DrawTextBox(left,top,width,height,"4 spaces    10 spaces:          end",0);
what is really in th pdf is: 4 spaces 10 spaces: end

Btw when using DrawText, the above problem does not appear.

Thanx in advance,

stakon



Replies:
Posted By: Ingo
Date Posted: 07 Dec 09 at 9:59AM
Hi Stakon!

It's not a bug - It's a feature ;-)
The developers had thought that it makes more sense to remove the spaces while using textboxes.
But you has already seen how to avoid this behavior (using DrawText)...
BTW: Is it the same if you're using Chr(32) instead of real space?

Cheers, Ingo


Posted By: stakon
Date Posted: 07 Dec 09 at 10:56AM
Hi Ingo,

I guess then that  it is a buggy feature :p
A more useful implementation would be to set the truncating on/off in the options parameter...
I also tried your idea by providing ("%c",32) but it was just the same.
By using DrawText i lose much of the DrawTextBox convenience...

How can i make a request, so that this "fetaure" becomes friendlier?

stakon.



Posted By: Ingo
Date Posted: 07 Dec 09 at 12:35PM
Hi!

In the general section i've posted soemthing for this case "the first step...".

Cheers, Ingo


Posted By: JanN
Date Posted: 08 Dec 09 at 2:19PM
http://quickpdf.org/forum/adding-spaces-to-text-field_topic1271_post5839.html


Posted By: Rowan
Date Posted: 11 Dec 09 at 6:12AM
Ingo is right, it's by design.

The DrawTextBox function splits the text into words to do the wrapping and when it puts the words back together again it just adds a single space. Using Chr(160) should fix the problem as it is a non-breaking space. For the DrawHTMLText function the   entity can be used.

Cheers,
- Rowan.


Posted By: stakon
Date Posted: 11 Dec 09 at 7:44AM
Chr(160) works fine.


Thanx to all
!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk