Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Flag for stop exit

Posted on 2004-11-29
10
Medium Priority
?
235 Views
Last Modified: 2008-02-20
Is there any way to set a flag like a checkbox that doesn't allow a user to exit out of reader without checking the box. What is happening is the person keeps closing reader without finishing the form and loses their information. I did the form in acrobat 6.0 professional. Please help with suggestions (besides wacking the user and telling her to slow down when closing windows).
0
Comment
Question by:jerrycsakanyjr
  • 4
  • 4
8 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12700638
Unfortunately this is not possible from within a form and just JavaScript. You can however create a document level JavaScript that will be called just before the document closes. This will be called regardless of how the document got closed (e.g. user closes the document, Reader is closed). It will not work if the Reader gets killed with the task manager.

You could for example put up a message box that says: Do you want to submit the data? <Yes> <No>

This still will not help if your user has filled the form only partially, but unfortunately there is no way to cancel the closing of the document from within JavaScript. Is the document submitted to a server? If so, you may want to implement the submission of partially filled out forms, and give the user the ability to recall such a form to finish it.

Otherwise, whacking the user a few times may be the simpler solution :-)
0
 

Author Comment

by:jerrycsakanyjr
ID: 12700750
There is no submission, it is just a form w/ a lot of fields. But i would be willing to consider submitting it to a server if you could explain the procedure, of doing this and the retrieval process.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12701252
If you don't have the forms submission infrastructure already in place, I'm not sure that you should add it just because your users have problems with the workflow.
What I don't like about Reader is that it warns you that you cannot save the form when you start to edit it (if you have not disabled this warning already), but it does not tell you that it's closing a document that you modified. Even though you cannot save the document, it would be nice if it would give the the chance to cancel closing a document. This at least would give you an indication that the document was modified.

How much work are you willing to put into this? If you really, really, really want to put up a web server just to store partially edited forms, I can give you some pointers about how to do that. Do you have any experience with web servers and/or with web scripting languages? Do you have a Web server available that you could use to play with? If so, is it Windows or Unix/Linux/Mac?

The general idea is to submit a FDF file to the server, which contains the current status of your form. You can then save this FDF file on the server, and when you user wants to continue, serve this FDF file back to the user. A FDF file can automatically open a PDF file when you store it's location in the FDF data. You may want to do this when the user submits the file.

With some more processing, you can even merge the form and the forms data on the server and serve a plain PDF file (non-interactive) back to the user for archiving purposes.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 

Author Comment

by:jerrycsakanyjr
ID: 12705917
In house we have 2 servers 1 linux box and another which is  a win 2000 server which is used just for saving word and other windows related docs. We also have a web server that is off site and is maintained by an outside vendor that is located next door. That machine is a linux box as well. If you can give me a start of how to do the following i'll give it a try.

The general idea is to submit a FDF file to the server, which contains the current status of your form. You can then save this FDF file on the server, and when you user wants to continue, serve this FDF file back to the user. A FDF file can automatically open a PDF file when you store it's location in the FDF data. You may want to do this when the user submits the file.

With some more processing, you can even merge the form and the forms data on the server and serve a plain PDF file (non-interactive) back to the user for archiving purposes.
0
 

Author Comment

by:jerrycsakanyjr
ID: 12709131
I added some code to the "Did close" and a button on the form that does an import fdf file. The did close routine exports the form as a file with a name given by the user. This works fine in full acrobat, but not in reader...is this feature not available in reader? I have javascript enabled !
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12709178
This feature is not available in Reader. Do you have the Acrobat JavaScript Reference? It has information about which software supports which methods.

Reader only supports the submission to a web server of FDF data. All other mechanisms (e.g. writing to a file or emailing the FDF file) are only supported by the full version of Acrobat.

Do you know if one of your servers supports PHP? This is the only environment that I have code for to process the submission of a FDF file.
0
 

Author Comment

by:jerrycsakanyjr
ID: 12709196
yes it does support php!
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 2000 total points
ID: 12711648
Good. Once you have a submission mechanism in your form, create a web page that contains PHP code similar to this:

<?php
$ffdf = fopen("pathTo.fdf", "w");
fputs($ffdf, $HTTP_RAW_POST_DATA);
fclose($ffdf);
?>

You may want to send some data back to the client to avoid any error messages (but as a first test, if you just store these few lines into a file named "submit.php" and put this up on your web server, and use the path to this file as your submission URL, it will create a file "pathTo.fdf" (you need write access to the directory that you specify).

You need to decide about what to do with this file. I would store it either just as a file or in a database with some information about the user, the PDF file used and the time submitted. When you lookup this information again, you can then retrieve this file again. If you look into it, you will see a "/F" key that points to the original location of the PDF file. If the file was moved since the form was submitted, the FDF file will not be able to retrieve the PDF file. What you can do is, change this path so that it points to the file on the web server. You can use a URL as "/F" path. When you then serve this FDF file back to the client, the browser will bring up Acrobat and load the FDF file. The FDF file will then load the PDF file and merge the data from the FDF file.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Getting information about Fonts being used in a PDF file A colleague of mine recently faced an issue related to the PDF file format. The PDFs were containing mission critical client information, they were successfully mailed but there was a sm…
Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe A recent question here at Experts Exchange piqued my interest, so I decided to provide a thorough solution and publ…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

564 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