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 - FitTextBox doesnt work
  FAQ FAQ  Forum Search   Register Register  Login Login

FitTextBox doesnt work

 Post Reply Post Reply
Author
Message
jabaltie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 Nov 05
Location: Brazil
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote jabaltie Quote  Post ReplyReply Direct Link To This Post Topic: FitTextBox doesnt work
    Posted: 04 Jan 08 at 11:41AM
I have some PDF templates that look like contracts. They're PDFs with empty form fields.

I'm removing the form fields and replacing them by using DrawTextBox instead (because FlattenFormField function is messy).

On some paragraphs , there's a field supplied for the client name and for this kind of field, FitTextBox would be better than using DrawTextBox.

Except that it doesnt work Cry

Guess there's some detail that I dont know.

I have made a script to reproduce the problem :

-----------

OPTION EXPLICIT

DIM objQPDF,lni,lnt
DIM X,Y,W,H,A,S

Set objQPDF = WScript.CreateObject("ISED.QUICKPDF")

objQPDF.unlockkey("yourkey")

objQPDF.NewDocument()
objQPDF.DocumentCount()

objQPDF.LoadFromFile("TEST035.PDF")

' GET TEST035.PDF from http://www.DES.online.unimep.br/au/pub/TEST035.pdf

lni=1

X=objQPDF.GetFormFieldBound(lni,0)
Y=objQPDF.GetFormFieldBound(lni,1)
W=objQPDF.GetFormFieldBound(lni,2)
H=objQPDF.GetFormFieldBound(lni,3)
A=objQPDF.GetFormFieldAlignment(lni)
S=objQPDF.GetFormFieldTextSize(lni)

lnt=objQPDF.FORMFIELDCOUNT()
for lni=lnt to 1 step -1
  objQPDF.DeleteFormField(lni)
next

objQPDF.SetTextAlign(A)
objQPDF.SetTextSize(S)

CALL objQPDF.FITTEXTBOX(X,Y,W,H,"JOSE ADRIANO BALTIERI",2)

objQPDF.SaveToFile("TEST035.PDF")

WScript.Echo "OK !"

--------------------

I'd expect to have "JOSE ADRIANO BALTIERI" scattered but it appears at the right, pretty much like as if I had used the DrawTextBox function.

What it would be wrong ?

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: 04 Jan 08 at 12:03PM
I think you had better read the document more closely. It doesn't say it will spread out text to fit available space, it says it will shrink the font size so that long text will fit in the available space.

There are functions available to calculate the length of the text to be printed, then you can calculate the difference and use SetTextCharSpacing to spread out the text, if you wish.

Edited by chicks - 04 Jan 08 at 12:06PM
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