Print Page | Close Window

SetTextScaling + Align Right problem

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=870
Printed Date: 14 May 24 at 4:32AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: SetTextScaling + Align Right problem
Posted By: Compertis
Subject: SetTextScaling + Align Right problem
Date Posted: 28 Feb 08 at 6:10AM
I found a problem with the text scaling
I'm drawing Right-Aligned fields on a pre-printed module
PDF lib version = 4.41 (I think I don't need to update it because I didn't find any fix I really need, and because I will need to update it in every place I use the software)
Measurement Units = mm
Origin = top left
Language = VB

Since the scaling with Left-Align works right
Draw Align Left, scaling 100%
------------------

|XXXXXXXX        |
------------------


Draw Align Left, scaling 50%
------------------

|XXXX            |
------------------


the problems come with the Right alignment

Draw Align Right, scaling 100%
------------------

|        XXXXXXXX|
------------------


Draw Align Right, scaling 50%
I got
------------------

|        XXXX    |
------------------

but I expected
------------------

|            XXXX|
------------------


I'm trying to fix it by moving the text right of the difference between the text width = 100 and the text width = myTextScaling
offset = GetTextWidth(text) - ((GetTextWidth(text) / 100) * myTextScaling)

DrawText x + offset, y, text

I need obtain the scaled text width by hand because GetTextWidth() returns always the width at 100%
The problem is that the offset I calculate is never accurate and the text is printed always at the wrong position

Thank you for any help,
Daniele



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