Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add a Field to PDF Document
Message
De
22/10/2009 14:27:29
Steven Dyke
Safran Seats USA
Texas, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Add a Field to PDF Document
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01430745
Message ID:
01430745
Vues:
108
It appears that Acrobat has changed to way some automation functions work between Version 8 and 9.

I have had code that added fields with javascript in them to act as a date stamp when the document was printed. The functions I had working added these fields in the background without the PDF actually becoming visible. Now I understand to use the AFormAut.App features requires the document be visible in the viewer.

However, There is supposed to be a way to use JavaScriptObject to do this in the background but I cannot get it to work. The addField generates an error Invalid Argument Type...

Can someone help with this?
Local whatDrawingNumber
whatDrawingNumber = "C:\862148-001C.pdf"

Local ispdffilee, array1

DIMENSION array1(4)

ispdffilee = .F.
ON Error

	avDocMM = CreateObject("AcroExch.PDDoc")
	
	If File(whatDrawingNumber) = .T. Then
		ispdffilee = avDocMM.Open(whatDrawingNumber)

		If ispdffilee = .T.
			
			jse3MM = avDocMM.GetJSObject
			dfrnopMM = jse3MM.numPages
			
			STORE 50 TO array1(1)
			STORE 20 TO array1(2)
			STORE 450 TO array1(3)
			STORE 0 TO array1(4)
			
			For x = 0 To dfrnopMM - 1
				jse4MM = jse3MM.addField("test","text",0,array1)
					
			Next x
			
			avDocMM.Close()
			
		Else
		
			avDocMM.Close()
			
		EndIf
	Else
		
		avDocMM.Close()
		
	EndIf
Répondre
Fil
Voir

Click here to load this message in the networking platform