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!
Empty form field on a PDF |
Post Reply |
Author | |
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
Posted: 29 Nov 07 at 11:36AM |
I've used FormMax for years with good results. Also use NitroPDF if needing to add form fields to an existing PDF.
BTW, AcroSoftware also has a form filling ActiveX component, but I haven't tried it. |
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
One more question 4 you Chicks :
You said you never had a problem with forms processing. How do you design your templates ? Do you draw them in Word and convert them using Adobe PRO or do you use something else to design these templates ? |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
This is exactly the same issue. You are trying to get the name of fields that don't exist. After half the fields have been flattened, LNI will be greater than the number of remaining fields, so GetFormFieldTitle(LNI) will return null.
Try ObjQpdf.GetFormFieldTitle(1), which should work fine. |
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
Thanks for your usual help Chicks.
I'm aware of the reference problem and on the REAL , PROduction server side code, it's done in reverse order. However, back to this topic here, I'm curious about this : Try to make the loop this way : FOR LNI=1 TO LNT FORMFIELDNAME=OBJQPDF.GETFORMFIELDTITLE(LNI) WSCRIPT.ECHO "FIELD #",LNI,": '" + FORMFIELDNAME + "'" IF NOT OBJQPDF.FLATTENFORMFIELD(1) = 1 THEN MSGBOX "ERROR WHILE FLATTENING THIS FORM FIELD '" + FORMFIELDNAME + "' ON " + ARQPDF WSCRIPT.QUIT(1) END IF NEXT It looks like after a while, all of the form fields will have a blank name. Is it supposed to be like that ? I'm doing it all cause I'm "lost" with a problem posted on another topic, where a damaged PDF is generated, that is, a PDF with wrong field contents.... Thanks again ! |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
This is the classic changing reference issue. As you flatten the fields, the internal reference numbers of form fields changes. What was FF1 no longer exists, so what was FF2 is now FF1, etc.
Simple solution is to FlattenFormField(1), instead of LNI. Another is to flatten in reverse order, from LNT to 1 step -1 Try this: Option Explicit Dim ObjArgs Dim ObjQpdf Dim ArQpdf Dim Lni Dim Lnt Dim FormFieldName Set ObjArgs=Wscript.Arguments ArQpdf=ObjArgs(0) Set ObjQpdf=Wscript.CreateObject("ised.quickpdf") If Not Objqpdf.UnlockKey("MY_KEY") = 1 Then Wscript.Echo "could Not Unlockkey" Wscript.Quit(1) End If If ObjQpdf.LoadFromFile(ArQpdf) = 0 Then Wscript.Echo "could Not Load Template" Wscript.Quit(1) End If Lnt=ObjQpdf.FormFieldCount() WScript.Echo Lnt & " fields found" For Lni=lnt To 1 Step -1 FormFieldName=ObjQpdf.GetFormFieldTitle(Lni) WScript.Echo Lni & Chr(9) & FormFieldName If Not ObjQpdf.FlattenFormField(lni) = 1 Then Wscript.Echo "error While Flattening This Form Field '" & FormFieldName & "' On " & Arqpdf,lni Wscript.Quit(1) End If Next Edited by chicks - 26 Nov 07 at 3:13PM |
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
I have a PDF template , which is a PDF with empty form fields.
This PDF template was designed using Open Office Writer. I suspect this PDF template has some problem, that is, there's a bug on Open Office Writer OR there's some problem with the FlattenFormField function..... Please take a look at the VBScript below. It loops across the PDF template form fields and flattens them all. Get the PDF template to use on this VBScript code from here : http://www.DES.online.unimep.br/au/pub/ag284d.pdf Follows the source code : ===================== OPTION EXPLICIT DIM OBJARGS DIM OBJQPDF DIM ARQPDF DIM LNI DIM LNT DIM FORMFIELDNAME SET OBJARGS=WScript.Arguments ARQPDF=OBJARGS(0) SET OBJQPDF=WSCRIPT.CREATEOBJECT("ISED.QUICKPDF") IF NOT OBJQPDF.UNLOCKKEY("yourkeyhere") = 1 THEN WSCRIPT.ECHO "COULD NOT UNLOCKKEY" WSCRIPT.QUIT(1) END IF IF OBJQPDF.LOADFROMFILE(ARQPDF) = 0 THEN WSCRIPT.ECHO "COULD NOT LOAD TEMPLATE" WSCRIPT.QUIT(1) END IF LNT=OBJQPDF.FORMFIELDCOUNT() FOR LNI=1 TO LNT FORMFIELDNAME=OBJQPDF.GETFORMFIELDTITLE(LNI) IF NOT OBJQPDF.FLATTENFORMFIELD(LNI) = 1 THEN WSCRIPT.ECHO "ERROR WHILE FLATTENING THIS FORM FIELD '" + FORMFIELDNAME + "' ON " + ARQPDF,LNI WSCRIPT.QUIT(1) END IF NEXT ================ Finally, questions are : Is this PDF template (http://www.DES.online.unimep.br/au/pub/ag284d.pdf) wrong or, is there some problem on FlattenFormField function ? Where does that empty form field comes from ? Cause it doesnt appear when I open the template using Acrobat Reader.... For those skilled with Adobe PROfessional, are there any tools on it that we can use to find out WHERE is the empty field on this PDF ? Thanks in advance 4 your support ! |
|
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