Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ITextSharp and wwDotNetBridge to fill in PDF forms
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01626591
Message ID:
01626710
Vues:
136
Is e: a network drive? If so try putting the images local to see if that makes a difference.

If that's the problem you need to add a .config file setting to allow network access to resources (and dll loading).

http://www.west-wind.com/webconnection/docs/?page=_36e0qlogr.htm

The topic mentions DLL loading but I think the same thing applies to any resources accessed cross the network. This setting basically makes a .NET application behave like a 'normal' Windows application without dealing with security policies.

+++ Rick ---



>Hi All.
>
>I am using this code to fill in fillable PDF forms (error checking removed for brevity)
>
>
>Do wwDotNetBridge
>loBridge = CREATEOBJECT("wwDotNetBridge", "V4")
>loFdfReader = loBridge.CreateInstance("iTextSharp.text.pdf.FdfReader", tcFDF_nme)
>loPdfReader = loBridge.CreateInstance("iTextSharp.text.pdf.PdfReader", tcTemplate_nme)
>loFileMode = loBridge.CreateComValue()
>loFileMode.SetValueFromStaticProperty("System.IO.FileMode", "Create")
>loFileStream = loBridge.CreateInstance("System.IO.FileStream", tcPDF_nme, loFileMode)
>loStamper = loBridge.CreateInstance("iTextSharp.text.pdf.PdfStamper", loPdfReader, loFileStream, ;
>	loBridge.ConvertToDotNetValue(0, "byte"), .t.)
>loStamper.AcroFields.SetFields(loFdfReader)
>
>
>This code works flawlessly. The problem is the next few lines of code that I added in order to change the image on a command button. It runs without error, but it doesn't change the image on the command button either.
>
>
>loForm = loStamper.AcroFields
>loCmd = loBridge.InvokeMethod(loForm, "GetNewPushbuttonFromField", "cmdSignature")
>loSig = loBridge.InvokeStaticMethod("iTextSharp.text.Image", "GetInstance", "E:\Marcia\MGASig.tif")
>loBridge.setstaticproperty(loCmd, "Image", loSig)
>loBridge.InvokeMethod(loForm, "ReplacePushbuttonField", "cmdSignature", loCmd.Field)
>
>
>Does anyone have any idea what the problem might be?
>
>TIA.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform