Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PDF information to put in a database
Message
From
26/10/2004 11:14:31
 
 
To
26/10/2004 10:41:37
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00953562
Message ID:
00954562
Views:
15
Your're welcome. You may also be interested in this. I am working on streamlining the same thing basically and researching the pdf sdk I found a way to read the values from the pdf form using automation and/or javascript from vfp:
*--This example Requires the pdf form test.pdf with the following formfield 
*--names (all are case sensitive):

*        "AGENCY.NAME"
*        "AGENCY.ADDR1"
*        "AGENCY.CITYSTZIP"


sFieldName  = "AGENCY.NAME"
sFieldName2 = "AGENCY.ADDR1"
sFieldName3 = "AGENCY.CITYSTZIP"

AcroExchAVDoc = CreateObject("AcroExch.AVDoc")

sfileName = "C:\acordforms\test\test.pdf"
IF !FILE(sFileName)
	=MESSAGEBOX('Cannot locate: '+sfilename)
	sFileName=GETFILE('pdf','PDF File:','Open',1,'Please select a pdf file with the formfield AGENCY.ADDR1')
	IF !FILE(sFileName)
		=MESSAGEBOX('Cannot locate: '+sfilename)
		RETURN
	ENDIF
ENDIF

AcroExchAVDoc.Open(sFileName, "")
AcroForm = CreateObject("AFormAut.App")
AcroFields = AcroForm.Fields

*--Get the value of the first field AGENCY.NAME in our test.pdf
AcroField  = AcroFields.Item(sFieldName)
*--Get the value of the 2nd field AGENCY.ADDR1 in our test.pdf
AcroField2 = AcroFields.Item(sFieldName2)

MESSAGEBOX(PADR(PADL("FORMFIELD AGENCY.NAME value:",40),80)+CHR(13)+AcroField.Value+CHR(13)+CHR(13);
          +PADR(PADL("FORMFIELD AGENCY.ADDR1 value:",40),80)+CHR(13)+AcroField2.Value,0+64+4096,"Value Retrieved by Automation")

*--Get the value of the citystzip formfield using javascript
sJS = "event.value = this.getField("+"'"+sFieldName3+"'"+").value;"
sValue = AcroForm.Fields.ExecuteThisJavaScript(sJS)

=MESSAGEBOX(PADR(PADL("AGENCY.CITYSTZIP value:",40),80)+CHR(13)+sValue+CHR(13),0+64+4096,"Value Retrieved by JavaScript")
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform