Solved

form fields need recalculation after pages are inserted or prior to viewing, printing

Posted on 2011-02-11
4
341 Views
Last Modified: 2012-05-11
I have a two-page PDF (sample.pdf) that has a different form field (field01, field02) on each page that contains the formula:

event.value = "Page " + (event.target.page + 1) + " of " + this.numPages;

This lets each page calculate its own position within the document. This works fine until I insert a cover page. The revised document continues to show "Page 1 of 2" and "Page 2 of 2" until I bring up the console and manually call this.calculateNow(). Then the fields recalc and show "Page 2 of 3" and "Page 3 of 3" like I want. I want to change sample.pdf so that it recalculates after pages are added / deleted / moved or before it is viewed or printed. What event can I change so that sample.pdf is an easily insertable component of packets that I create?

TIA,
pT72
0
Comment
Question by:pteranodon72
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 34880711
The easiest way to accomplish this is by creating a document level script that calls the recalculate function. When you create the script, make sure that you are calling that function outside of the function body that Acrobat suggests by default (you can delete that function, you don't need it).

You still would have to save and reload the document in order for the page numbers to be correct, but the next time somebody will open that document, the page numbers would be correct.
0
 
LVL 14

Author Comment

by:pteranodon72
ID: 34888753
That makes sense. I've read about the Doc/Open event, but Acrobat 8 Pro will only guides me to creating scripts on Will Close, Will Save, Did Save, Will Print, and Did Print actions. If I name my own function in Document Javascripts and then follow the function definition with a call to the function, will that code run at Doc/Open?

Thanks,
pT72
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 34889007
As I said, you can create a document level script that will be executed when the document opens. Acrobat will create a function stub for you - you don't need that, so remove that in the editor window. Now anything that you add to the editor window will get executed when the document opens. So, if you just call the is.calculateNow() function (again, this needs to be done outside of a function), it will run when you open the document. Give it a try. If it's not working, I can give you step by step instructions.
0
 
LVL 14

Author Closing Comment

by:pteranodon72
ID: 34889601
That makes sense. I thought the document level scripts were just for definition of functions to be used elsewhere. I didn't realize that code can be called from them and it will run when the document is opened.

Thanks for your help.

pT72
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
PDF files have been in the limelight due to its unmatched features.  Personal documents, emails, business reports and eBooks are all converted into PDF files owing to peerless features provided by it. Adding watermark to a PDF file is a method to se…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
Suggested Courses

732 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