Print Page | Close Window

GetHTMLTextHeight bug?

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=753
Printed Date: 17 May 24 at 10:21AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: GetHTMLTextHeight bug?
Posted By: Hopeful
Subject: GetHTMLTextHeight bug?
Date Posted: 30 Jun 07 at 12:59PM
I am using v 5.22.0.119 of the library
 
For a single line of text (which appears fine is the resulting PDF doc), I get the correct result from GetWrappedTextHeight (5.8250666666667mm). However, for the same text and width, GetHTMLTextHeight returns 1239476.0000000
 
Is this a bug?



Replies:
Posted By: Ingo
Date Posted: 30 Jun 07 at 1:14PM
Hi!

What's your complete line of code in this case?
The HTML-functions are completely different from the normal pdf-functions.
I THINK the font height is relative to the value for "width" and the string-length.

Best regards,
Ingo



Posted By: Hopeful
Date Posted: 30 Jun 07 at 4:33PM
Hi Ingo
It's nice to get such a quick reply Smile
 
Here's the relevant lines of (C++) code:
double WidthBetweenMargins = 92.0;
 
   double tmp1 = isedFunctions.GetHTMLTextHeight(WidthBetweenMargins, "Sample text which fits on a single line");

   double tmp2 = isedFunctions.GetWrappedTextHeight(WidthBetweenMargins, "Sample text which fits on a single line");
Before this code there is the following:
 isedFunctions.SetMeasurementUnits(1); // 1 = millimetres
 isedFunctions.SetPageDimensions(112, 600);
 isedFunctions.SetOrigin(1);  // top left
Colin


Posted By: Ingo
Date Posted: 01 Jul 07 at 3:31AM
Hi!
I don't think that the html-functions works like the other ones having to do with fonts and text. Try setmeasurementunits(0) (for pixels)... Is the returned value okay?
Best regards,
Ingo


Posted By: Hopeful
Date Posted: 01 Jul 07 at 3:51AM
I tried SetMeasurementUnits(0) and the two calls still return completely different values.
I don't see why the html-functions should be any different - I thought that they were just taking the html formatting into consideration.


Posted By: Hopeful
Date Posted: 02 Jul 07 at 1:48PM

Ingo

I am going to have a look at the source code to see if I can work out what's going on (unless Marian beats me to it Smile). I have the source code to v 3.78 - please tell me where to send one of the .pas files to prove this so that I can get the latest source.

Colin


Posted By: Ingo
Date Posted: 02 Jul 07 at 2:44PM
Hi Colin!

EVERY help is welcome.  Many shoulders are better than one ;-)
You can send the pas-file to Michel or me.
After this you'll get the password for the download-section.

Best regards,
Ingo


Posted By: marian_pascalau
Date Posted: 02 Jul 07 at 4:55PM
Hi Hopeful, Hi Ingo,
send please a sample of your problem to mailto:support@quickpdf.org - support@quickpdf.org and I will check your problem. I will send correction to Ingo and he will integrate into the last public sourcecode release.
 
Best regards, Marian


Posted By: Hopeful
Date Posted: 14 Jul 07 at 6:13AM
This turned out to NOT be a bug. I am using the dll with a Visual C++ application and I have to create my own set of header files. I had mistakenly declared GetHTMLTextHeight as returning an int instead of a double Embarrassed



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