PXC_DrawTextExW - difference with no space at end of string

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-Tools SDK of Library DLL functions(only) - Please use the PDF-XChange Drivers API SDK Forum for assistance with all PDF Print Driver related topics.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Post Reply
ken66
User
Posts: 50
Joined: Mon May 16, 2005 5:10 pm

PXC_DrawTextExW - difference with no space at end of string

Post by ken66 » Wed May 25, 2005 6:04 pm

Sorry to keep bothering you, I hope that I am not annoying you.

I have attached my test Visual C++ 6 project again. This time PXC_DrawTextExW outputs a string differently if there is a space at the end of the string or not.

You will notice first write is using a string "Cable ID:" with no space after the colon (':'). Only the "Cable" portion of the string appears in the PDF file. The second write is using a string "Cable ID: " with a space after the colon (':'). The whole string appears in the PDF.

Is this a bug?
Attachments
test.zip
(876.57 KiB) Downloaded 91 times

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Thu May 26, 2005 10:02 am

Hi Ken,

No problem.

This issue arises because you are using integer based arithmetic and our libraries - use floating point Arithmetic.

For example, our library returns a string width of 30.1 points, then you convert this to an integer value - the result - 30.0.

You then pass this length back to the library and there is not enough space to show the entire string (because the string width is 30.1 and not 30).

Hope that makes things a little clearer
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply