Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Pad Text To A Specific Length |
Post Reply ![]() |
Author | |
MrPopup ![]() Team Player ![]() ![]() Joined: 19 Dec 05 Location: New Zealand Status: Offline Points: 32 |
![]() ![]() ![]() ![]() ![]() Posted: 20 Aug 12 at 1:52AM |
Using QuickPDF 8.16 ActiveX.
I am generating a document with an index page and have the index entry text on the left and the related page number of the right. How can I extend the index text (padded with '.' (periods)) to the page number? Example: "Monthly Results...................................................................................109" Thank you for any assistance rendered.
![]() |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
You should be able to calculate using something based on the code below. You will need to determine the value of totalColumWidth your self. It assumes you have the required font currently selected. double left = QP.GetTextWidth("Monthly Results"); double right = QP.GetTextWidth("109"); double dotWidth = QP.GetTextWidth("."); gapToFill = totalColumWidth - left - right; dotsRequired = gapToFill / dotWidth; text = left + DotString(dotsRequired) + right; QP.DrawText(x, y, text); |
|
![]() |
|
MrPopup ![]() Team Player ![]() ![]() Joined: 19 Dec 05 Location: New Zealand Status: Offline Points: 32 |
![]() ![]() ![]() ![]() ![]() |
Thank you AndrewC. Appreciate the help.
![]() |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store