Print Page | Close Window

TextOut and TextWidth

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


Topic: TextOut and TextWidth
Posted By: mauricef
Subject: TextOut and TextWidth
Date Posted: 23 May 17 at 3:44PM
I'm building a PDF using the canvas, so I'm calling GetCanvasDC and LoadFromCanvasDC, and in between have a series of calls to Canvas.TextOut. The text being written to the canvas needs to be right-aligned so I'm using Canvas.TextWidth to calculate the start offset of the text in relation to the right-hand edge of the page. I have two distinct issues with this.

Firstly TextWidth doesn't seem to be very accurate. The longer the text being printed, the bigger the gap I have between the end of the text and the right-hand edge of the page. Secondly if the text being printed is only a single character then it prints the text in a tiny font. If two characters the font is slightly bigger, and if three characters or more it prints in the correct font size.

Has anyone else experienced problems like this?



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