Err.png (14.7 KB)
XFAPDF.pdf (1.7 MB)
Hello,
i try to open a XFA-Document (see attachment), set one field-value in the XFA-Document and save it with same filename.
Even when i don’t try to change the field-value, i get the following error.
I’am using this code:
Dim doc As New Document("C:\temp\XFAPDF.pdf")
If doc.Form.Type = Forms.FormType.Dynamic AndAlso Not doc.Form.XFA Is Nothing AndAlso doc.Form.XFA.FieldNames.Count > 0 Then
doc.Form.XFA.Item("us-request[0].ContentArea[0].sfApplicantInformation[0]sfApplicantName[0].firstName[0]") = "test"
End If
doc.Save() '<---- Here i get the error
Can you tell me what i’am doing wrong?
PS: I have to use the same filename for writing the changes cause otherwise Adobe Reader will not open the changed file correctly.
With kind regards,
T. Bunger
bei System.IO.BinaryWriter..ctor(Stream output, Encoding encoding, Boolean leaveOpen)
bei System.IO.BinaryWriter..ctor(Stream output)
bei ..ctor(Stream )
bei . (Stream )
bei ..ctor(Stream , )
bei . (Stream , )
bei . ()
bei . ()
bei Aspose.Pdf.Document.Save()
bei XFA_Test.Form1.Button1_Click(Object sender, EventArgs e) in \\pbgfs1\Home\tbu\Eigene Dateien\Visual Studio-Projekte\XFA_Test\XFA_Test\XFA_Test\Form1.vb:Zeile 30.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
bei XFA_Test.My.MyApplication.Main(String[] Args) in :Zeile 81.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()<a class="attachment" href="/uploads/default/4907">Err.png</a> (14.7 KB)