These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Submitting a Form Adds Newline Characters in the FormData

leanmattie
Registered: May 4 2009
Posts: 8

I have been given a pdf form. I believe it is a PDF XFA form. I have a button that the end user can click and when they do so, it posts the form data as XML to a url. The problem I am having is that it seems to be adding in newline characters like so:
<?xml version="1.0" encoding="UTF-8"?>
1234

(this isn't complete stream, just a small sample. The newlines are screwing up my xml parser. Is there any way I can prevent this, or post lean xml with no whitespace?

I have been stripping newline characters inside my service, but obviously this is less than ideal.

With Respect,

mattie

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Inserting CRs into the end of a tag is an odd one. However, I would think any decent XML parser would ignore white space. But if you really want to deal with this you could send the data out directly or generate the XML yourself before sending it out to the server script.

For example
event.target.submitForm({cURL:"MyUrl", cSubmitAs:"XML", oXML:xfa.dataset.data});

This code sends out the XML data directly.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

leanmattie
Registered: May 4 2009
Posts: 8
Where would I put this code?