PDF Forms

Thanks to Maciej Hanski, who kindly translated the original file from Polish to English. The content of this page is licensed under the Free Documentation License.

One of the advantages of Scribus is the possibility to create PDF forms with embedded JavaScript scripts (as described in the Adobe JavaScript Reference).

It’s quite simple to create a new form with Scribus. Start by clicking on the “New Document” icon or choosing New from the File menu.

Next, activate the grid (Page > Snap to Grid) and make it visible (View > Show Grid). This will help you to correctly place your form fields on the page. Then create some text frames as field descriptions.

Now you can start adding form elements. The toolbox for form elements is available in the Toolbar:

To add a PDF text field, click on the second button from the left and create a text frame. In this sample form, you will need one PDF text field for each entry: “Name,” “Street/No” and “ZIP Code/Town.”. To create a PDF button, use the button at the left of the Toolbar.

As you can see in the screenshot above, all PDF form items use blue lines to indicate frame borders. To edit the PDF form properties of a field, right-click and select “PDF Options > Field Properties”:

The “Field Properties” dialog is mostly self-explanatory, and it’s impossible to explain all options in detail here. For the purpose of this introduction it’s important that you assign a unique name to each PDF text field and that the field type is “Text.” The name is important, as it can be used by external scripts to process the form data. e.g. if you use your form to send data to a website. You can also let Scribus validate the correctness of the data inserted by the user of the PDF, e.g. if a field requires a numerical value. If Scribus’s limited validation options are insufficient for your purposes, you can use JavaScript to create more sophisticated ones.

To send inserted data from your PDF viewer, you need to add a “Submit” button to your form. Create a button as described above and open the field properties dialog from the Context Menu:

Note that the “Action” tab allows for much more than just “submit” actions, as you can see from the drop-down list “Type.”

When you export your form to PDF, you are advised to choose at least PDF 1.4 in the PDF Export dialog.

Maciej Hanski, October 2003
Updated by Christoph Schäfer, September 2011

Some useful PDF/JavaScript Links

Some useful CGI/PHP links