Print Page | Close Window

Space trimming

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=378
Printed Date: 19 May 24 at 5:24PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Space trimming
Posted By: GregS
Subject: Space trimming
Date Posted: 30 Mar 06 at 3:48PM
Hi, we're using QuickPDF around here and we're trying to dump some text from an RTF file into a PDF with the FitTextBox function. The problem we're encountering is that QuickPDF is "trim"ing spaces in the text. So if I have leading spaces to more a word over, the excess space (anything more than a single space or maybe 2 after a period) is cut, so input like:
Hello          World

Is rendered as:
Hello World

This is kind of inconvenient for what we're trying to do, is there a way to force QuickPDF to recognize the spacing?



Replies:
Posted By: JanN
Date Posted: 30 Mar 06 at 4:56PM
You could try to substitute the "normal" space with the ascii character 160.


Posted By: hbarclay
Date Posted: 30 Mar 06 at 5:22PM
Originally posted by GregS GregS wrote:


input like:
Hello          World

Is rendered as:
Hello World
spacing?



I haven't tested this with the FitTextBox function, but wouldn't this just be a matter of selecting a Fixed Width font instead of a Variable Width font.



Posted By: swb1
Date Posted: 30 Mar 06 at 6:07PM

The problem is not font related.

 

The FitTextBox routine makes a call to a wraptext function that removes superfluous spaces, tabs and other common white space characters in an effort to make sure that the text will fit in the boundaries supplied.

 

Jan’s suggestion of using #160 in place of the spaces should work.

 

Regards

sb



Posted By: GregS
Date Posted: 31 Mar 06 at 4:46PM
Worked like a champ, thanks. :)



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