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!
FitTextBox doesnt work |
Post Reply |
Author | |
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
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 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 ? |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
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 |
|
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