Skip to main content
Top

2017 | Book

Enhancing Adobe Acrobat DC Forms with JavaScript

insite
SEARCH

About this book

Take your PDF forms to the next level. In this book, you'll learn various ways to further improve your PDF Forms using simple JavaScript coding. You’ll also discover how a few lines of code can speed up your workflow when working with multiple PDFs in Action Wizard.
Enhancing Adobe Acrobat DC Forms with JavaScript covers up-to-date, real working examples that you can easily download, practice with, and edit to suit your own projects. Using screenshots from Adobe Acrobat DC, users or previous versions will also be able to utilize these techniques. This book also shows workarounds and solutions to various form issues you might encounter. Feel empowered by it and improve your PDF documents!
JavaScript has been a part of Adobe Acrobat for many versions. However, few people use its features and focus mainly on using the basic form properties, never delving deeper into Acrobat’s full capabilities. While information on the web can be helpful, if you don’t know enough about how to use JavaScript in Acrobat you will be left with poor results. JavaScript can be difficult to learn, but it does not need to be scary. This book explains it in simple steps at a beginner to intermediate level so you can take full advantage of Acrobat’s capabilities in your own projects.
What You’ll Learn

• Create calculations, rating forms, and QR code stamps using the form elements• Explore simplified field notation and basic JavaScript for Acrobat• Work with buttons that can be used for navigation• Utilize complex forms that include drop down and list boxes in combination with other form fields• Work with Action Wizard and JavaScript• Improve form navigation and printing of forms• Add various types of alerts and custom validations to improve client-entered-data
Who This Book Is ForAnyone who needs to create forms for clients or websites: students, lawyers, accountants, and human resource personnel

Table of Contents

Frontmatter

Basic Form Improvements

Frontmatter
Chapter 1. A Fundamental Forms Primer
Abstract
You’ve all probably opened and viewed a PDF file. And the program that made that possible was most likely Adobe Acrobat Reader or Acrobat Pro DC. For many computer users, Reader has become the industry standard simply because it is a freeware program that anyone can download for Mac or PC platforms.
Jennifer Harder
Chapter 2. Introduction to Actions
Abstract
Now that you have reviewed the basic form properties, you will begin your study of JavaScript by taking a closer look at several types of automatic or preprogramed actions that can be applied within various tabs within each field. In this chapter, you’ll be working with forms and you’ll discover how actions can be applied.
Jennifer Harder
Chapter 3. Creating a QR Code Custom Stamp
Abstract
You’ve all probably opened and viewed a PDF file. And the program that made that possible was most likely Adobe Acrobat Reader or Acrobat Pro DC. For many computer users, Reader has become the industry standard simply because it is a freeware program that anyone can download for Mac or PC platforms.
Jennifer Harder
Chapter 4. Buttons, Navigation, Form and Non-Form Actions
Abstract
In Chapter 2, you saw a few simple examples of actions you could create with buttons. Now you will focus on a few more. This chapter will cover
Jennifer Harder

Simplified Field Notation and Basic JavaScript

Frontmatter
Chapter 5. Introduction to Simplified Field Notation and JavaScript
Abstract
In this chapter, you will first explore simplified field notation (SFN) used in Excel and how it compares to JavaScript. This will set the groundwork for what you can expect in the rest of the book.
Jennifer Harder
Chapter 6. Basic and Complex Calculations
Abstract
In the first example of JavaScript calculations in this chapter, we will compare three methods: Value, simplified field notation (SFN), and JavaScript as found in the Calculate tab in the Text and Dropdown Menu form fields, as shown in Figure 6-1
Jennifer Harder
Chapter 7. Format Calculations
Abstract
In this chapter, you'll be working with Number, Percentage, Date, and Time formats using simplified field notation (SFN) and Value. Let’s look at where it works and doesn’t. You’ll also need some JavaScript to assist you.
Jennifer Harder
Chapter 8. Various JavaScript Alerts, Notes, and Time Stamps
Abstract
As you have seen in previous chapters, JavaScript is very useful for forms when you want to do calculations.
Jennifer Harder
Chapter 9. Create Help for Clients with Rollover Text and Alerts
Abstract
In Chapter 4, you learned that you can create a small help menu with the order form using buttons that hide and show. However, if you need your text to be more detailed, this method might not always be the best solution. Luckily, in Acrobat there are a few other methods you can use that can assist you with creating help for your client.
Jennifer Harder
Chapter 10. Various Types of Formatting with JavaScript
Abstract
In the last chapter, you looked at creating various alerts that could assist your clients in knowing when they entered incorrect information. In this chapter, you will explore ways that you can globally and individually alter the appearance of various fields so that they conform to a set format you choose. You will also alter the appearance of the resultant value depending on what radio buttons or check boxes are chosen. Other topics you will tackle are
Jennifer Harder

Working with More Complex Forms

Frontmatter
Chapter 11. Validation with Text Boxes, Alerts, and Radio Buttons
Abstract
The JavaScript becomes more complex as multiple form fields work in tandem.
Jennifer Harder
Chapter 12. Working with Dropdown Menus
Abstract
So far you have looked at ways to improve text boxes, buttons, radio buttons, and check boxes with JavaScript. However, there are other types of fields that can be dynamic as well. In this chapter, you are going to take a look at incorporating JavaScript with dropdown menus so that information will be accurately entered or calculated in order to avoid clients entering incorrect information.
Jennifer Harder
Chapter 13. Working with List Boxes
Abstract
The last main type of form field you are going to explore is list boxes. In my experience, list boxes are the most underused of form fields. While they may not be as compact as dropdowns, they are great for helping organize a list of priorities.
Jennifer Harder
Chapter 14. Advanced Navigation: The Popup Menu
Abstract
In this chapter, you’ll look at the final example on buttons and navigation: a popup menu. The files can be found in the Gem Show Booklet PDF in this chapter’s download folder.
Jennifer Harder

Beyond the Basics

Frontmatter
Chapter 15. Action Wizard and JavaScript
Abstract
This chapter is a collection of extra lessons that I added to the end of the book for those who are more advanced users of JavaScript.
Jennifer Harder
Chapter 16. Multi-State Check Boxes
Abstract
When space is limited in a document it is often helpful to be able to combine multiple states into one field. For example, suppose that you have a form and in it you would like to be able to change the setting from blank to a check symbol (representing yes) to an X or cross symbol (representing no or wrong). Or maybe you have multiple symbols that represent distinct levels. As the user who fills out the form advances in skill, they require a frequent update to their status in a specific order. In this chapter, you’ll see how to create a type of multi-state check box using a button field.
Jennifer Harder
Chapter 17. Importing an Image into a Button
Abstract
In this chapter, you’ll create a button that will import an icon image using a script. This could be useful for clients who want to attach an image or photo to the form.
Jennifer Harder
Chapter 18. Multiple Formatting
Abstract
One of the most laborious tasks that I have found when creating forms in Acrobat is formatting many fields to Numbers. Wouldn’t it be nice if Acrobat were like MS Excel, and you could format the fields all at once? And what if you need to format them all again? Do you want to go through them one at a time? What if you could update them quickly?
Jennifer Harder
Chapter 19. Digital Signatures and Barcodes
Abstract
Throughout this book two form fields were not discussed in great detail in regards to JavaScript: digital signatures and barcodes. Thus, this chapter focuses on them. Let’s first look at how they and other fields relate to security.
Jennifer Harder

Putting It into Practice

Frontmatter
Chapter 20. Homework Assignments
Abstract
To complete the assignments in this chapter, be sure to download the Chapter 20 folder at www.apress.com/9781484228920.
Jennifer Harder
Backmatter
Metadata
Title
Enhancing Adobe Acrobat DC Forms with JavaScript
Author
Jennifer Harder
Copyright Year
2017
Publisher
Apress
Electronic ISBN
978-1-4842-2893-7
Print ISBN
978-1-4842-2892-0
DOI
https://doi.org/10.1007/978-1-4842-2893-7