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

Converting Acrobat PDF to LiveCycle - Javascript Differences

BAWD001
Registered: Jan 21 2009
Posts: 47
Answered

I've created a reasonably functional PDF input form in Acrobat 9 Standard for my client's Adobe Reader users (accessible from their website) to enter job quotation specifications. Users can save the Password-secured document with extended rights for saving filled in data. They can print and email the document too.

My client now wishes to extend that functionality to allow the user to submit that filled in form as an actual order. The new functionality requires displaying a 2nd PDF page that allows for entry of name, address, phone, and email address information. The address information will allow for calculation of shipping charges (based on a calculated shipping weight and the ship-to address). Once filled in, the user will need to be able to submit that form to my client. From there, my client would receive the emailed PDF form, open it, view the information and be able to phone their client back to get credit card information for billing purposes (my client does not currently have nor currently intends to have an SSL secure website for storing/processing their clients credit card information). In the future, I hope to be able to provide an additional "ordering" option that will upload pertinent order information to PayPal for secure credit card processing on their server as an alternate method.

I believe I know how to design this 2nd page but also believe such a PDF should be designed with LiveCycle for proper workflow management and onscreen aesthetics (eg. subform #1 for job specification, subform #2 for entering name, address, etc. and submitting the order via email).

Is my assumption to use LiveCycle correct?

If so, I'll need to upgrade my Acrobat 9 Standard software to Acrobat 9 Pro which includes the LiveCycle ES software.

My main concern, having looked through some of the forum posts, is that LiveCycle Javascript is different than Acrobat Javascript.

My questions are:
1. Will LiveCycle be able to import the current Acrobat-generated PDF and keep/convert the existing JavaScript code (eg. most input fields have custom keystroke scripts)?
2. If not, is there a guide that can walk me through the conversion process?
3. Would I be better off starting the entire 2-page LiveCycle PDF form from scratch?

Any input would be helpful. Thank you.

My Product Information:
Acrobat Standard 9.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Quote:
Is my assumption to use LiveCycle correct?
I would say no. You should be able to create a form that looks and behaves like you want with the tools in Acrobat. LiveCycle Designer is required if you need certain dynamic elements, such as fields that can grow/shrink, or new data entry lines added to a table.

When you say "proper workflow management", what do you mean, exactly?

George
BAWD001
Registered: Jan 21 2009
Posts: 47
By "workflow management" I guess I mean that I'd prefer that the user not see the 2nd page (address/shipping information) until they've filled in the 1st page (job specification data) and choose to proceed with an order (by clicking a button to get to that 2nd page). It'll often be the case that users will use the 1st page to play with costs but not actually order at that time. They'd still need to print/save and/or email that form without being forced to enter the address/shipping info.

Ideally, I'd prefer not to have to switch to using LiveCycle, but am unsure if I could create a reasonable clean design in Acrobat 9 Standard that would have the following characteristics:

1. Allow entry, printing, saving and emailing of the 1st page quotation form only (as it does now).

2. Have a button on the 1st page that when clicked will display the 2nd page ONLY (i.e. not simply scrolling down to a 2nd page but providing the appearance of a distinct 2nd subform overlaid onscreen where the 1st page subform was displayed). Note: The word subform is simply used for descriptive purposes ... as long as the user can button-toggle (not scroll) between the 1st page and the second page in the same onscreen footprint, I'm fine.

3. The 2nd page would have the address/shipping calc info (that could potentially update read-only shipping info on the 1st page) and a final Submit button as well as a button to switch back to the 1st page.

3. The ability to print the 1st page alone if no data was entered into the 2nd page (with a description i.e. "Print Quotation Form"), print the 2nd page alone (with a description i.e. "Print Shipping Information) or both pages.

Will Acrobat 9 Standard allow me to accomplish this? Do you have any tips (re: hiding/displaying pages, conditionally printing the 1st page only if nothing entered into the 2nd page, etc.) with Acrobat 9 Standard?

Do you think I need to upgrade to Acrobat 9 Pro just for some of the higher level JavaScripting (eg. document level scripting vs. being limited to lower level (eg. field level) scripting with the Standard version)?
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Most of what you're talking about is possible in Acrobat. But I have to ask why #2 is so important? What is wrong with having a second page along with the first? I don't think implementing that would be any less troublesome with LiveCycle Designer. You can always enable the second page once the first is sufficiently complete and the user decides to proceed.

#1 and both #3s are straightforward and easy to implement in Acrobat.

If Standard does not allow you to place document-level code and you think you will be doing a lot of this type of work, I would encourage you to upgrade to the Pro version.

Regarding tips on how much of this can be done, there a lot of good resources here in the Learning Center tutorials that you can access via the link above.

If you do not already have the Acrobat JavaScript reference and the accompanying Scripting Guide, you should get them now and become familiar with them. You can get them here as PDFs: http://www.adobe.com/devnet/acrobat/javascript.php

For the updated versions, you'll have to get the Acrobat 9 SDK and use the HTML versions.

George
BAWD001
Registered: Jan 21 2009
Posts: 47
RE: Overlaid screen swapping
I just think this is the visually ergonomic thing to do. In most work-flow software I've seen or designed, you generally have specific tasks or data sets to manage on one screen before going on to the next task or data set on another screen (occupying the same onscreen real estate). Indeed, many systems have different people entering subsequent work-flow information once someone else has done their bit (not so with this form's requirements, but in general) and it all gets done on a single non-scrolling screen (e.g. with Tabs for accessing the different information sets).

Because of this, and because for this application the complete job specification, address and shipping information cannot be readably contained on a single screen (or printed on a single 8.5x11 sheet of paper), I'd prefer a two-page (read "Tabbed subforms") document that simply button-tabs between data input sets, uses the same screen space and doesn't have to scroll up and down between pages.

It does look like I'll need to upgrade to Acrobat 9 Pro anyway just for its richness of features. However, from your comments, it doesn't sound like Acrobat (Pro or Standard) or LiveCycle will readily accommodate my screen-swapping preference. I assume this is because PDFs evolved as a substitute/enhancement to paper forms and not from say spreadheet or database software systems. As I've already made the commitment to do this as a PDF (primarily because of its internet ubiquity) I guess I'll just have to use a more pedestrian two-page scrolling layout unless further research proves otherwise.

Bottom Line: I guess you're saying there is no easy (or hard) way to have two pages occupy the same screen space with access to say a document-level page.display (visible/hidden options) property that could be toggled between pages by pressing a button?

I do thank you for your input, George.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
I'm not saying you can't have a single page and swap the contents, because you can. I've implemented an ebook using a similar approach. The PDF itself has only a single page, but the visible contents of the page is controlled by JavaScript. (BTW, I'm talking about Acrobat forms here. You may be able to do this with XFA forms as well.)

One way would be to use layers for the underlying page contents and use JavaScript to control which gets displayed. You can also use JavaScript to control which fields are displayed. Thom Parker has a nice article here that gives a lot of good information about JavaScript and layers. You can also use buttons to implement something similar, which is what I did with my ebook.

For a wizard-like data entry system, you can use custom dialogs. See Thom Parker's AcroDialogs product at http://www.windjack.com for more information. Here's a nice demo: http://www.windjack.com/WindJack/Examples/MultipartFormWizard_Demo2reg.pdf

To print both pages you would have to set up a routine that displays the first page, prints it, switches to the second "page", and prints it again. Possible, if a bit out of the ordinary.

When such a document is saved, the data will be retained as long as it's contained in the form fields. The recipient would simply need to know how to get it all to display and/or export it.

I hope you don't think I'm trying to discourage you from anything. Good luck.

George
BAWD001
Registered: Jan 21 2009
Posts: 47
I will have to think about this and do some research on using layers.

The printing could be OK as long as clicking the Adobe Reader Toolbar's Print icon would properly print the current displayed page. Printing both pages with the click of a button might not be necessary (especially if it requires displaying the first page, printing it, then displaying the second page and printing it ... all while the user looks on in disbelief at the onscreen gyrations).

Looks like I've got some work to do but I now feel more comfortable approaching the job ahead with Acrobat ... though I still think I'll upgrade to Acrobat Pro to be sure I'll have all the functionality I may need.

Thanks again George.

P.S. I'm not discouraged at all ... maybe just a little overwhelmed (chuckle).