I have a PDF Form desinged using Adobe LiveCycle Desinger ES2.
It has a submit button which will submit the form to the server (IIS and ASP.NET) using this javascript command:
event.target.submitForm( {cURL: "http://server/ASPNETWebPage.ASPX", aPackets:["datasets","pdf"], cSubmitAs: "XDP"});
On the server, from ASP.NET, I use the following code to extract the submitted "chunk" element and convert it from Base64 to Binary PDF File:
fs = New System.IO.FileStream(mFormFileNameFolder, IO.FileMode.Create)
bw = New System.IO.BinaryWriter(fs)
' Get chunk element form the submitted XML
Dim srChunk As New StringReader(mXML.GetElementsByTagName("chunk")(0).InnerXml)
Do While True
Dim theChunkLine As String
theChunkLine = srChunk.ReadLine
If Not String.IsNullOrEmpty(theChunkLine) Then
theReadBytes = theChunkLine.Length
Else
theReadBytes = 0
Exit Do
End If
Dim theBase64Length = (theReadBytes * 3 / 4)
Dim buffer() As Byte
buffer = Convert.FromBase64String(theChunkLine)
bw.Write(buffer)
Loop
bw.Close()
bw = Nothing
fs.Close()
fs = Nothing
The above code is working fine, and PDF is generted successfully.
I have one problem.
With every submit, the generated PDF Size will increase dramatically. I reported this to Adobe Support, and they cofirmed that this is by desing and that with every submit, the previous PDF State is saved, and the new state is added. That is why I get huge PDF File.
I was told that the only way to solve this problem is to submit the form as PDF ONLY, and after I save the PDF File on a file system, I then must use Adobe Service/Process "exportData" to extract the XML Data from the PDF.
I think this is really big change to me. I was hoping that there is a way to indentify the latest PDF State from the chunk element.
Any help will be greatly appreciated.
Tarek.