Print Page | Close Window

DrawHTMLTextBox - issue with non breaking space

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=3112
Printed Date: 04 Apr 26 at 7:28PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: DrawHTMLTextBox - issue with non breaking space
Posted By: MarcoFischer
Subject: DrawHTMLTextBox - issue with non breaking space
Date Posted: 04 May 15 at 6:46PM
Hello,

see the following example for this issue:

http://download.photoident.de/A02_0001.pdf" rel="nofollow - http://download.photoident.de/A02_0001.pdf

To hold the number and the name together, i use non breaking spaces ( ) between the number and the name parts. Only in front of the next number i use a simple blank to get a line break if nessessary.

... 5 Edith Gloxin; 6 Horst "Hottel" Morgenroth; ...

This works perfect without any HTML formatting.

By using HTML formatting the following non breaking space don't work:

... <B>5</B>&nbsp;Edith&nbsp;Gloxin; <B>6</B>&nbsp;Horst&nbsp;"Hottel"&nbsp;Morgenroth; ...
OR
... <B>5&nbsp;</B>Edith&nbsp;Gloxin; <B>6&nbsp;</B>Horst&nbsp;"Hottel"&nbsp;Morgenroth; ...

I know, &nbsp; are not supported according to "Appendix A - Supported HTML tags", but it works perfect until there is a html tag before or after the non breaking space.

Are there any other solutions to control line breaking?

Thanks for any information.

Best regards

Marco



Replies:
Posted By: erico
Date Posted: 05 May 15 at 4:28PM
It appears that the HTML tags are being recognized as word break locations.

You may need to preemptively handle the line breaking by measuring the text before adding it. Look at GetHTMLTextWidth() for this. Combine as many names/numbers as will fit on one line, then force a line break before the next number.


-------------
Eric O



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