Your second PDF form with Scribus (and Javascript): Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
Line 28: Line 28:


==Calculate form field values==
==Calculate form field values==
[[Image:Calculate button action.png]]


{{CC_BY_SA_and_GNU_FDL|2008|Maciej Hański and subsequent Scribus Wiki authors mentioned in the article history}}
{{CC_BY_SA_and_GNU_FDL|2008|Maciej Hański and subsequent Scribus Wiki authors mentioned in the article history}}

Revision as of 23:28, 2 February 2008

  1. Your first PDF form with Scribus
  2. How to create an e-Mail PDF Survey Form
  3. Your second PDF form with Scribus
  4. Enhance PDF forms with JavaScript

Work in progress!

Introduction

JavaScript functions in a PDF document

Teaching material will be made available for download asap.

Adding new functions

Go to Edit/Javascripts... and click on Add. Choose a name for your new function and click on OK to launch the built-in JavaScript editor.

Javascript on launch1.png

Let us call our first function RunOnLaunch and start with a simple alert that will be displayed on launching the PDF formular in Adobe Reader:

function RunOnLaunch() {
  app.alert('Welcome to the Scribus Demo Form!');
}

Launching JavaScript functions

Go to File/Export/Save as PDF and click on the Viewer tab. Choose the JavaScript to be executed from the Special Actions drop down list. Save the PDF document and open in with the Adobe Reader to see how it works.

Javascript on launch2.png

Adding JavaScript to PDF form elements

Validate form fields

Calculate form field values

Calculate button action.png


(c)

The content of this page is available under the Creative Commons Attribution-ShareAlike Licence and Free Documentation Licence

If you alter, transform, or build upon this work, you may distribute the resulting work either under one or under both of the abovementioned licences.