Ask a Question related to Adobe Acrobat SDK, Design and Development.
-
sharmishta #41
Re: Using SDK to Extract Form Data to XML
I need to fill an xfa form using acrobat.
I have used the following code:
Type AcrobatCAcroAppType = Type.GetTypeFromProgID("AcroExch.AVDoc");
Type AcrobatPDDocType = Type.GetTypeFromProgID("AcroExch.PDDoc");
if ((AcrobatCAcroAppType == null) || (AcrobatPDDocType == null))
throw new Exception("Acrobat not installed on this system.");
CAcroAVDoc avDoc = (Acrobat.CAcroAVDoc)Activator.CreateInstance(Acrob atCAcroAppType);
CAcroPDDoc pdDoc = (Acrobat.CAcroPDDoc)Activator.CreateInstance(Acrob atPDDocType);
// Open the pdf
if (!avDoc.Open(fileName, ""))
{
string szMsg = "Cannot open" + fileName + ".";
throw new Exception(szMsg);
}
pdDoc.Open(fileName);
dynamic jsObj = pdDoc.GetJSObject();
jsObj.getXMLData();
But jsObj.getXMLData(); throws an exception "Value does not fall within the expected range."
System.ArgumentException: Value does not fall within the expected range.
at System.Runtime.InteropServices.Marshal.ThrowExcept ionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExcept ionForHR(Int32 errorCode)
at System.Dynamic.ComRuntimeHelpers.CheckIfMissingTyp eInfoIsExpected(Int32 hresult, Boolean throwIfMissingExpectedTypeInfo)
at System.Dynamic.ComRuntimeHelpers.GetITypeInfoFromI Dispatch(IDispatch dispatch, Boolean throwIfMissingExpectedTypeInfo)
at System.Dynamic.IDispatchComObject.EnsureScanDefine dMethods()
at System.Dynamic.IDispatchComObject.System.Dynamic.I DynamicMetaObjectProvider.GetMetaObject(Expression parameter)
at System.Dynamic.DynamicMetaObject.Create(Object value, Expression expression)
at System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection`1 parameters, LabelTarget returnLabel)
at System.Runtime.CompilerServices.CallSiteBinder.Bin dCore[T](CallSite`1 site, Object[] args)
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at CallSite.Target(Closure , CallSite , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoi d1[T0](CallSite site, T0 arg0)
Please let me know what I am missing out. I am very new to xfa forms.sharmishta Guest
-
Extract Layer With Data
I have one PDF File which contain multiple layers. I want to store each layer into seprate PDF? May i get some suggestion to use Acrobat SDK/PDF... -
Extract Data from PDF
Does anyone make a plug-in that would extract info from a PDF for use as a file name? We receive about 50 pdf's each evening, copies of invoices,... -
extract data between certain date.
Hi all. I have a data base with purchases. Now i am trying to write a report page to allow me to see what has been bougth between certain dates. I... -
extract data from adobe form field
Hello all, I need to know how to extract inputted data on the form fields to create a text file. Thanks!



Reply With Quote

