Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

submit PDF data to servlet

Avatar

Level 2

Hiii

I am new to LiveCycle Desiger suite. I have created a form using live cycle .When user fill the form , i want this info to pass servlet

End users are using Adobe reader 8 and above. Can it possible??

How to submit this pdf data to servlet??

Plz guide

Thanks

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

You will need a submit button on the form and you can put the URL for your servlet in the "Submit To URL" field on the Submit tab of the Field Palette.

Paul

View solution in original post

7 Replies

Avatar

Correct answer by
Former Community Member

You will need a submit button on the form and you can put the URL for your servlet in the "Submit To URL" field on the Submit tab of the Field Palette.

Paul

Avatar

Level 2

Hi,

As pguerett have said, you'll need submit button with URL inside.

Required version is Adobe Reader 6.0.2 or later so there will be no problem if you're using 8 or above.

Restriction will be that from Adobe Reader, you can only define XML data or HTTP post.

For other connections, you will need some extra server software "Adobe LiveCycle Reader Extensions"

http://kb2.adobe.com/cps/332/332289.html

In the servlet side, HTTP post will be just like other HTTP post, and for XML data you can find the data in request's inputstream,

Avatar

Level 2

Hii

Thanks for reply

Let I will try today.

Avatar

Level 2

hiii

Bamboomania and paul

Thanks friends,

I have also added some javascript in PDF.

I pass some parameters throgh url to PDF and then display this parameters in PDF fields .

Javascript is as follows :

var

sURL = event.target.URL;

var

nRequestStart = sURL.indexOf("?");

if

(nRequestStart > 0)

{

var sRequest = sURL.substr(nRequestStart + 1);

this.rawValue

= sRequest;

var aRequests = new Array();

aRequests

= sRequest.split("?");

this.rawValue

=decodeURI(decodeURIComponent(aRequests[0].substr(7)));

}

This code work well in adobe reader and acrobat also (some user use acobat).

but now when I user this  HTTP button , form works well in abode reader

but show soem alert message in acrobat 7.0 pro such as

Invalide enumerated value:urlencoded

The fault occurred on line 626

After this message pdf get open , but submit only null values to servlet.

Is that required any onther settings on abode acrobat ??

Thanks

Avatar

Level 2

Hi,

It seems that theres a little difference between ver. 7 and 8.

I never tried Acrobat 7 or 8 but I found following post which might be the same issue.

http://forums.adobe.com/thread/435023?tstart=0

Avatar

Former Community Member

Hi,

1. Can you please tell me how should I show the xml in JSP? Or in other words, how can I retreive the submitted XML in my jsp?

2. What javascript should I write in form's presubmit event so that I can see the whole xml that is going to be submitted?

Thanks!

Avatar

Level 2

Hi,

I usually use asp and not familier with the jsp's, but it should be pretty much the same.

In the LCD,

1. use normal button and

2. set property "Control type" to submit,

3. put the URL that you are connecting to "submit" tab's "Submit to URL" box,

4. select "XML" for "submit as" combo

then on servlet side, you should find the xml data at "response.inputstream" or something similar in JSP command.

to see the XML inside the PDF using the Javascript, use following snipet,

xfa.datasets.data.saveXML("pretty");

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----