Creating a PDF Form with Scribus

From Scribus Documentation Project

Jump to: navigation, search

What we want to do in this chapter is to go through the process of creating a relatively simple PDF form with Scribus, incorporating at least the basic elements than can be used. Since there are many options, we will not plan to cover all of them, but some aspects of forms, such as JavaScript will be covered in later sections.

Contents

A Demonstration Form

Let's envision that we want to do a brief survey by collecting some basic biographical information, then some various opinions and other kinds of information.

We'll plan on collecting this information:

  • The person's name
  • Address
  • City, Country
  • Then ask them to make a series of choices

Text Field

Image:Textfields.png

Here is the beginning of our form. The frames outlined in black containing text are regular text frames. The others are special text frames called Text Fields, obtained by selecting text field from the drop-down list in the menu bar. PDF form elements will not be found in the menus. For visual simplicity, we have kept the background plain, but depending on your preference, you might choose to use a grid or guides to assist with placement and alignment of these frames. A text field will be used to allow for filling out the space freely from the keyboard, rather than supplying choices.

Image:Pdffieldprops1.png When we right-click on each of these text fields, then choose PDF Options > Field Properties from the context menu, this dialog comes up. Instead of Text1, we will want to enter the variable name for each piece of data, so for our form, the Text Fields will have the variable names Name, Address, City, and Country.

In our example, we will keep things simple, but for our Name category we might, for example, type "First, (MI), Last" as a Tool-Tip so those filling out the form know our preferred entry order.

In contrast to regular text frames, we have limited choices for various features of our form fields. If we export to PDF version 1.3, for our font we can only choose regular, bold and italic forms of Courier, Helvetica, and Times, plus Symbols and Zapf Dingbats. The color of the border has a full range of choices, but the thickness can only be None, Thin, Normal, and Wide. Choices in Style are Solid, Dashed, Underline, Beveled, and Inset.

Image:Pdffieldprops2.png In our Options tab, we have these checkbox choices, but for our example we will leave all unchecked. Do Not Scroll and Do Not Spellcheck will have no effect with PDF 1.3.

The Action tab only gives us a choice of None or Javascript, so this will not be shown further here.

Image:Textfields format.png For our example we will leave the format as Plain (as in plain text). Other choices are:
  • Number, for which you can select number of decimal places, the character to use to indicate the decimal separator (period or comma), and whether to add a currency symbol.
  • Percentage, where again we can choose the number of decimal places and the character to show the decimal separator.
  • Date – various date formats possible.
  • Time – again various format choices are shown.
  • Custom, where one must enter some personalized way of making a format for the entry.
Image:Textfields validate.png In the Validate tab, we have a number of ways to check the entry into our text field. For our example, we will not make any changes.
Image:Textfields calculate.png Finally, in the Calculate tab, we can change the settings to cause this field to be the sum, product, average, minimum, or maximum of a set of other fields in our form. We can also have a Custom method of calculation. For our example, we will choose Value is not calculated.

Check Box

Image:Checkboxes.png Checkboxes are a relatively simple element, with only a few options. You must manually size your box, and you can choose between the choices you see here.

Enlarge the size of your mark with the font size spinbox in Properties > Text tab. Since you will not see this mark in Scribus, some experimentation will be necessary to balance the size of the check with the size of the box. The default can be either to have the box checked or unchecked. Each of these will of course have an associated text frame for the corresponding choice, and you must also align the text frame manually with the checkbox.

The Action tab for checkboxes also allows triggering of some JavaScript operation.

Combo Box and List Box

In many ways a Combo Box is similar to a List Box, so these will be described together here. Each allows you to choose an item from a list of choices, although the way these are displayed is somewhat different. A Combo Box will show only one choice regardless of its height as the default. In contrast, a List Box will show as many as can be seen for the height of the frame.

Unlike the PDF Fields mentioned thus far, you will see the contents of these boxes in Scribus. Create them to the desired height and width, then use Story Editor to make the list of choices, each on a separate line. After saving and closing Story Editor, now bring up the PDF Options > Field Properties dialog as we have before.

Here we see how the Combo Box appears in Adobe Reader after clicking the drop-down button. It may make more sense to use a Combo Box when the list of choices is long and especially when very different from one another, or for some other reason you want to be able to see all at once.
Here then is the List Box sized to only choice show one at a time. List Boxes can make more sense when the various choices occur in some natural order. Image:Listbox.png
If you look at the Options tab in Field Properties, it would appear that you can allow entries in a Combo Box and a List Box to be editable, but you will find that only Combo Boxes can be edited in Adobe Reader. This may also be a reason to choose one over the other. Image:Combobox_editable.png

Button

Although Button is the top choice in the Insert PDF Fields list, we're mentioning it last, since in many cases it will be something you click on after you have filled in or selected choices in other form elements.

Let's focus on a particular type of button, a Submit button. Here we see this as one of the choices in the Action tab:

Image:Buttonactions.png

You can have your button say anything you like, but usually something simple works best.

Image:Submit.png

Image:Submitform.png When you select Submit Form, you then need to enter the URL where your data will be sent. On the receiving end, you must have some way, such as a PHP file, to accept the information from the form.

If your system is set up properly, you can alternatively enter mailto:, then an email address for sending the information from the form.

In some cases, as shown here, you will want to check Submit Data as HTML. If you do not check this, the data will be sent in Adobe's FDF format. When submitting to a URL, your PHP file will need to be able to handle the appropriate data format. In either case, Adobe Reader must allow transmission of data, and the receiving site must allow for reception of this information.

Other Options

One thing you will not be able to do with a PDF form generated by Scribus is to save the data directly from Adobe Reader.

You can, however, simply print the completed form on a local printer.

Personal tools