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!
Drawing Text on PDF forms |
Post Reply |
Author | |
loufeliz
Beginner Joined: 27 Nov 05 Location: United States Status: Offline Points: 14 |
Post Options
Thanks(0)
Posted: 27 Nov 05 at 1:17PM |
I am succesfully using QuickPDF to take Forms, determine form field positions and then after manually removing form fields build documents using multiple pages of same form page. My problem now is that each page has a collumn of numbers and I need them to print Right Aligned, but instead they are printing left aligned.
I need some help or quidance on workig with fonts and how to get draw text that is Right Aligned. Once solved QuickPDF will replace a solution that is slow and requires MS Word to generate a Word Document instead of a PDF. - Lou Edited by loufeliz |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Lou,
i think you've read all about SetFormFieldAlignment in the documentation? Are you sure to work on the formfields you want? What are the returned values of SetFormFieldAlignment? ...0 or 1? What happens if you're working with GetFormFieldalue? Comes your values back with right alignement? I've made the experiences that working with formfields isn't easy. Good luck! Best regards, Ingo |
|
Cheers,
Ingo |
|
loufeliz
Beginner Joined: 27 Nov 05 Location: United States Status: Offline Points: 14 |
Post Options
Thanks(0)
|
Hi Ingo, Actually I am not using formfields. I am just drawing the text at a set of coordinates. Proiblem is that I need numbers to right align and when I put a collumn of values the allign on left instead of right as below: 65.23 21,100.45 Not sure how to ge the to right align. When you have lots of values it is not very nice to look at. Anyway I am guessing I need to do some font work or calculate the width and adjust coordinates, just looking for some guidance.
- Lou |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Lou!
If you write numeric fields in the output the alignment should work. When you're working with numeric values on a pdf document you're working only with the content (and a 1.5 is shorter than 123.25). You can work with form fields. If you don't want you must detect the string length of each single value to write it in the document a few pixels to the right or a few pixels to the left. ...I think you should take formfields. |
|
Cheers,
Ingo |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
If you know the width of your column, use SetTextAlign() with DrawTextBox().
Have a look at Invoice.pdf here: http://www.planetpdf.com/forumarchive/94629.asp It was laid out with a visual tool, then saved as PDF. The variable data was then printed on the static PDF using iSEDQuickPDF, including the right-aligned columns. See iSedPE.zip to see how it was done (iTextPE.zip is a java version - you can also use the .NET version of iText to do the same in .NET) Edited by chicks |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Chicks,
do you think that's easier than using formfields? |
|
Cheers,
Ingo |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
Not easier, but OP states that he's not using form fields.
It is, however, much more flexible than form fields - note that you can print images and barcodes (without a barcode font), which you can't do with form fields. Also note that flattening doesn't always work well with QuickPDF, but this method always works. The original template DOES have form fields, but they're just used for positioning, font info, etc. before being removed. The final PDF is also smaller than with flattened form fields. |
|
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