Solved

Opening and submitting multiples PDF forms from web site

Posted on 2007-03-27
24
464 Views
Last Modified: 2010-04-06
Hello Experts,

We have about 7 PDF forms that we want to put on our web site.  They are insurance Acord forms.  These forms are on PDF format and they are already mapped with all fields. Acord forms are standard forms used on the insurance industry.  For example, I can take an Acord form 125 and fax it to different markets to request insurance quotes without changing anything on the form.
 
One of the seven forms (Acord 125) is the commercial insurance application.  The rest of the forms are for the different line of business (General Liability, Property, Workers Comp, Etc.).  So, if I fill out a 125 (Commercial Insurance App) and specify on it that I want GL and Property; I have to attach a property app and a GL app with the 125 app.  We want to pull agents to our web site.  They only way an agent will go to our web site and fill out an app is if they can use the same app with other markets.  They won’t fill out an Acord 125 to request quotes with 3 insurance companies and then go to our web site and fill out a second proprietary form.  That’s why it’s so important for us to be able to get the forms on our web site.  
 
Here comes the tricky part.  I created a logic which I’m not sure if it the ideal way to get the forms from the web site.  There could be about 7 check boxes on the web site, one for each application.  If as an agent wants to apply for GL and Property, he checks the check box 2 (GL) and check box 3  (Property) and press the submit button, and a PDF document will open with form 125 and form 140 on the same document.  There could be a lot of combinations.  Checkbox 2 & 3, 3 & 5, 5 & 4, 1 & 7, etc.  
The form they will get will be mapped and set up to work with form router.
 
Do you know of any easy way to do this or do I have to create a PDF document for every possible combination the agent might choose?  

I was told that creating a pdf document with hidden templates for each app would work.  The agent fills out the first app and checks the boxes of all the applications they want and as they check the boxes, the form will be displayed.  This requires reader extensions to be enabled on the document.
 
If there is a better and cost effective way to do this, please let me know.
0
Comment
Question by:cartereverett
  • 9
  • 9
  • 4
  • +1
24 Comments
 
LVL 3

Expert Comment

by:Saber37886661
Comment Utility
If it was me, Id have html templates for my different forms/choices, build it into a html document using the templates, and then convert it to pdf using one of the 100's of html to pdf convertors. This would also allow you so extra flexibility if forms/layout change over time. It means that chances are the changes would just need to be done in html. I have used this way myself in one of my web applications and the client loved it as they could easily make changes to the templates.

So im sure it not quite the answer you probably wanted, but it may change the way you are thinking about the issue.
0
 
LVL 12

Expert Comment

by:viralypatel
Comment Utility
I feel that would be possible using dynamic creation of the required number of Iframes on the page according to user selection and then dynamically adjusting the height of the frames depending on the number.

MSDN reference here : http://msdn2.microsoft.com/en-us/library/aa681494.aspx
0
 
LVL 3

Expert Comment

by:Saber37886661
Comment Utility
Sorry, did I miss read, I thought you wanted to create it as a pdf so they can download it?
0
 
LVL 12

Expert Comment

by:viralypatel
Comment Utility
oh sorry .. then in addition to the solution mentioned above u can make use of this site that allows you to convert any type of document to PDF for free .... http://www.pdfonline.com/ ....

waht you can do is submit a request with their e-mail id and get it e-mailed straight to them. That makes it simple right ?
0
 
LVL 3

Expert Comment

by:Saber37886661
Comment Utility
lol certainly does, I couldnt do that with mine as the data was sensative, but I do like your solution :) so now all we need is cartereverett to wake up and read the posts :) ... mind you, it seems that looking at his question history, he isnt to fond of accepting solutions
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
Yes, you can use page templates in a PDF document. The problem with that is that it only works with the full version of Acrobat, but you can reader-enable such a form, so that it would also work with Reader. Formrouter.com does offer a service to reader-enable PDF forms, you have to find out if their product would include this feature (besides, e.g. the ability to save a partially filled out form from within reader, and other things).

Your PDF would inlcude all pages of all forms, and you would then, based on some input in the first form (which could be your list of checkboxes) create pages for all the required forms. You would need some JavaScript logic in your PDF document, but that should not be too complicated. The more complicated thing is to keep all the form fields separated, so that you can - by just looking at the form field name - determine which form it is from.
0
 

Author Comment

by:cartereverett
Comment Utility
I do appreciate all your comments.  I have not accepted any because I'm still trying to get as much info as possible.  

Is the method I described the best way to do what I want to achieve?

Do I have to create these templates on Adobe Designer or can they be created using Acrobat (I have Version 7 pro and Standard 8)?

A lot of our users are probably using version 6 of the reader.  If I design the document and get it reader-enabled, are they going to have to upgrade to a later version to be able to open with the docoment?

Thanks advance for all your comments.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
You would create these documents in Acrobat Professional (not Designer) - and if I remember correctly (I don't have Reader 6 installed anymore), you should be able to open and process these documents with Reader 6. This may however depend on the version of LifeCycle software FormRouter.com is using. You need to talk to their customer support to find out what the limitations are (and which features they can actually enable). I've never used them, so I don't have any first-hand experience.
0
 

Author Comment

by:cartereverett
Comment Utility
Do you know the javascript that I need to be able to make a hidden template show whenever the user click a checkbox for the desire application?
0
 
LVL 3

Expert Comment

by:Saber37886661
Comment Utility
<div id="hidden1" style="visibility:hidden">
template code here
</div>

<INPUT type="checkbox" onclick="if(this.checked=='true'){hidden1.visibility='visible';}else{hidden1.visibility='hidden';}">

give that a go :)
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
We are talking about Acrobat JavaScript here! This is different than the browser level JS from Saber's comment.

Do you have the JavaScript for Acrobat API Reference? If not, you really need that document - download it from Adobe's web site (http://www.adobe.com/devnet/acrobat/javascript.html)

In that document, browse to the "Template" section and look for the "spawn()" method. Do you know how to add templates to the document?
0
 

Author Comment

by:cartereverett
Comment Utility
I'm pretty much clueless when it comes to Javascript.  I can understand some stuff, but I would appreciate if you can explain your comment.

Maybe I did not explain myself well.  When I said I needed the hidden templates on a PDF document to show when the user click on a checkbox, I meant a PDF checkbox field.  

Also, once I have the script, where does each part (<div id=”hidden1”…etc.) go?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:cartereverett
Comment Utility
khkremer:

I download the JavaScript for Acrobat API Reference.  I created a test document with four pages, and I was able to set two of them as template and hide them.  

I haven't gone through the guide, but I can assume that it's a developer guide, not a newbie guide, right?

If you can describe exactly how to do what I need, the points will be yours.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
You are right, it's a reference manual for developers. I can come up with a sample, but this will take a bit longer. Can you wait until Monday?
0
 

Author Comment

by:cartereverett
Comment Utility
Absolutely!!!  Thanks man.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
OK, it's not Monday yet, but here is some information:

You've already managed to create template pages in your PDF. What you need to do is to create a PDF document that contains all your forms. Mark all forms pages as template pages with a naming convention like "Form1.1" for page 1 of form 1, "Form1.2" for page 2 of form 2 and so on. It is important that all forms can be identified by their base name. You cannot mark all pages of a document as templates, you need one page that will stay visible. That's the page that will contain your checkboxes and a button to actually create the form.
Let's assume that you have three forms, so you will have three checkboxes on the first page. Create a button on that page too. Use the following JavaScript as the mouse-up event handler:

var form1 = this.getField("Form1").value;
var form2 = this.getField("Form2").value;
var form3 = this.getField("Form3").value;

var addedPages = false;


var a = this.templates;
for (i = 0; i < a.length; i++)
{
      var showPage = false;
      var formName = a[i].name.substr(0,5);
      
      if (form1.value == "Yes" && formName == "Form1")
      {
            showPage = true;
            addedPages = true;
      }
      else if (form2 == "Yes" && formName == "Form2")
      {
            showPage = true;
            addedPages = true;
      }
      else if (form2 == "Yes" && formName == "Form3")
      {
            showPage = true;
            addedPages = true;
      }
      if (showPage)
      {
            a[i].spawn(this.numPages, false, false);
      }
}


if (addedPages)
{
      // hide the button so that we cannot add any more forms
      this.getField("Button").hidden = true;
      
      // set the checkboxes to readonly so that the user can no longer modify them
      this.getField("Form1").readonly = true;
      this.getField("Form2").readonly = true;
      this.getField("Form3").readonly = true;
}

// - end of form

As you can see, the forms are all named Form1.x Form2.x and Form3.x, the buttons are named Form1, Form2, and Form3. and the button is named Button.

I've also added some logic to make sure that you can only execute the button once. It does however not take into account that you can save the document and reload into Acrobat - that's up to you to implement :)
0
 

Author Comment

by:cartereverett
Comment Utility
khkremer:

That was great, but currently it is working if I check all 3 checkboxes.  I need it to display the templates regardless of the combination of checkboxes the user checks.  So, if they check form1 and 3 or form2 & 3 the templates can be shown.  Also, I can't use the button.  I need everything to work from the checkboxes.  When the user clicks CB1 the form should be displayed without having to click on a button.  Also, if the user unchecks the CB, the form should go back to hidden.  

I never thought about this, but I need one button at the end of the last page which would be the submit button.  I was thinking, let’s say form1 has 2 pages and form3 has 3 pages, I can put a submit button at the bottom of the last page of each form, and hide them.  Then, make the button visible only on the last page.

So, if the user chooses form 2 the button at the last page will be enabled.  If the user chooses form 2 & 3 then the button on form2, which by default is hidden, will stay hidden and the button at the bottom of form 3 will then be visible.

Sorry I didn’t explain myself well, but you are doing great.  I know you can handle it :-)
Your are getting closer to the 500 points :-)
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
It is possible to dynamically create/delete forms when the state of the checkbox changes but that's a lot more complicated because you need to keep track of which pages in the document belong to which form (to delete them again once the box gets unchecked).

The form should work with any combination of checkboxes - at least it does for me. I can select box 1 and 3, and then the forms 1 and 3 will be created. I suspect that you have something wrong in your form if it only works when all checkboxes are selected.

I'll spend some more time on this...
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
It took me a little longer than I tought, but I came up with a form that (I think) does what you need to do. Because it's too complicated to post all portions of the JavaScript here, I've uploaded a sample file to
http://www.khk.net/EEstuff/Q_22475397.pdf

Let me know if you need some explanations about what the JavaScript does.

As far as I can see, there is just one problem: When you save the document and reopen it, it can no longer remove a form that was added before the form was saved.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
I've uploaded the file also to an EE site to make sure that it will be available not only on my own site:

https://filedb.experts-exchange.com/incoming/ee-stuff/3086-Q_22475397.pdf
0
 

Author Comment

by:cartereverett
Comment Utility
Wow, that's exactly what I needed.  You are great.

 I noticed there are 5 javascripts (ACRO_Breakpoints, AddForm, AdjustFormData, RemoveForm & Setup) if I want to add these to my forms what exactly do I have to do?
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
Comment Utility
You can ignore the ACRO_Breakpoints document level script - it's just a leftover from my debugging.

You need to add the other document level scripts. You found the scripts, so I assume you know how to add document level scripts. Just add all four of them. You can actually combine them into one script and just add that. It does not matter where they are - as long as they are available. To combine them, just copy and paste the contents into e.g. Notepad and then create one document level script, give it a name, and then replace the function stub that Acrobat puts in with your combined script.

In addition to the document level script, you also need the JavaScripts for the checkboxes. As you can see, they have an action for both checking and unchecking the checkbox.  Make sure that you call the function with the correct form variable.

I forgot to mention one thing: THere is also a hidden checkbox, which is used to determine if the form was initialized. Initially the checkbox is unchecked. If the program finds this unchecked box, it will initialize the variables, and then check the checkbox so that the next time the software is run, it does not initialize the variables again.
0
 

Author Comment

by:cartereverett
Comment Utility
Wow, no wonder you have a genius Rank.  That worked great.  Thanks KHK.
0
 

Author Comment

by:cartereverett
Comment Utility
I will post another question soon, may be you can help me.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now