Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adobe FDF
Message
 
To
03/01/2001 12:12:10
Guy Pardoe
Pardoe Development Corporation
Peterborough, New Hampshire, United States
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
Miscellaneous
Thread ID:
00458971
Message ID:
00459429
Views:
26
Guy,

I have recently done it and found it very simple to understand the fdf format with just a little reading of the docs for such.

I used an fdf template with two variables: %=fields%' and %=pdfdoc% (with tag symbols around them) and from the docs you should be able to see where they fit into the fdf template.

Then in Web Connect it is simple to convert the template into a string and replace variables with the proper fdf format for the field names and values, and for the path to the pdf document that has the fields to fill in.

If the fdf has fields that the pdf does not those fields are ignored.

Then you send the string out with response.write or whatever.

That is all there is to it for displaying a pdf with table input to fields. It was fast enough for us even on large documents. I wouldn't get into it unless it was necessary for just minor compatibility problems and such, but this client needed to work with 100s of forms that existed in pdf already and not html.

To read an edited pdf form with fields back in is also documented by Adobe, but be aware that to send it back readable as though it were html there are two conditions that must be met. I can't remember now, but docs clearly mention them as pick return as html and something about the parameters that are sent back to Web Connect method must have something specific in them.

As far as code for outputting pdf/fdf:
function pdfprep && Associate names with field values for a pdf w/variables
if not this.checklevel('12345')
return
endif
local lcloan, lcPDF, lnCount, lcLevel, lcTable, lcField, lcLevel, lcValue, lnRecs, llRemote, lnBorr
private pcfields
pcfields=''
lcloan=request.form('loans__lnkey__00')
lcloan=iif(empty(lcloan),request.QueryString(3),lcloan)
lcPDF=alltrim(request.form('x__pdfname'))
if empty(lcPDF)
lcPDF=alltrim(request.QueryString(4))
endif
*!* if not this.loanexists(lcloan)
*!* return
*!* endif
* get preference fields
osql.csqlcursor='cids'
osql.Execute('select brokerid, agentid, lenderid, officerid from loans where lnkey=''+lcloan+''')
osql.Execute('update lendinfo set lnkey=''+lcloan+'' where id=''+alltrim(cids.lenderid)+''')
osql.Execute('update lendofficers set lnkey=''+lcloan+'' where id=''+alltrim(cids.officerid)+''')
osql.Execute('update brokerages set lnkey=''+lcloan+'' where id=''+alltrim(cids.brokerid)+''')
osql.Execute('update brokeragents set lnkey=''+lcloan+'' where id=''+alltrim(cids.agentid)+''')
* now get rest of lnkey type tables
osql.csqlcursor='cTables'
osql.Execute('select tablename, whichlevel from Tables')
select cTables
scan
osql.csqlcursor='cRecords'
lcsql='select * from '+alltrim(cTables.tablename)+' where lnkey=''+lcloan+'''
osql.Execute(lcsql)
if osql.lError
this.errormsg('SQL Error',osql.cErrorMsg+':'+lcsql)
return
endif
select cRecords
count to lnRecs
if lnRecs>=1
select cRecords
scan
lnCount=afields(aFlds)
for i=1 to lnCount
if not aFlds(i,2)='G'
lcTable=alltrim(cTables.tablename)
lcField=alltrim(aFlds(i,1))
do case
case cTables.whichlevel=1
lcLevel='00'
case cTables.whichlevel=2
lcLevel=alltrim(tran(cRecords.whichborr))+'0'
otherwise
lcLevel=alltrim(tran(cRecords.whichborr))+alltrim(tran(cRecords.idx))
endcase
lcValue=eval('cRecords.'+alltrim(aFlds(i,1)))
lcValue=nvl(lcValue,'')
lcValue=alltrim(tran(lcValue))
if not empty(lcValue)
pcfields=pcfields+'<>'+crlf
endif
endif
next
endscan
else
insert into log (timestamp,desc) values (datetime(),'Could not open table:'+alltrim(cTables.tablename))
endif
endscan
o=create('mergetable')
pcpdf='('+pdfpath+lcPDF+'.pdf)'
lcfdf=file2var(hpath + 'e2e.fdf')
response.contenttype='application/vnd.fdf'
response.write(o.MergeTable(lcfdf))
osql.Execute('update lendinfo set lnkey=''')
osql.Execute('update lendofficers set lnkey=''')
osql.Execute('update brokerages set lnkey=''')
osql.Execute('update brokeragents set lnkey=''')
this.closeall()
endfunc && eof pdfprep

Good luck
>Hi,
>
>I am wondering if anyone has done anything with Adobe FDF documents (Forms Document Format?) as a front-end to a Web Site.
>
>Apparently, these FDF documents can render in a browser (similar to a PDF) but allow for fields and 'posting' back to a Web Server. I have been looking at the FDF documentation but haven't been able to get my head around it yet. (Any meaningful examples in VFP would help.)
>
>I'm just exploring this to see how viable it may be as a Web front-end where some pages may required precise formatting of lines, boxes, fields, etc.
>
>Does anyone have any pointers or examples they could share from real experience?
>
>Guy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform