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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Drawing Text on PDF forms
  FAQ FAQ  Forum Search   Register Register  Login Login

Drawing Text on PDF forms

 Post Reply Post Reply
Author
Message
loufeliz View Drop Down
Beginner
Beginner


Joined: 27 Nov 05
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote loufeliz Quote  Post ReplyReply Direct Link To This Post Topic: Drawing Text on PDF forms
    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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 28 Nov 05 at 1:26AM
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

Back to Top
loufeliz View Drop Down
Beginner
Beginner


Joined: 27 Nov 05
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote loufeliz Quote  Post ReplyReply Direct Link To This Post Posted: 28 Nov 05 at 9:55AM

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

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 28 Nov 05 at 10:10AM
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

Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post Posted: 28 Nov 05 at 11:36AM
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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 28 Nov 05 at 5:23PM
Hi Chicks,

do you think that's easier than using formfields?
Cheers,
Ingo

Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post Posted: 28 Nov 05 at 5:28PM
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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store