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

From Scribus Wiki
Jump to: navigation, search
(Adding new functions)
(Adding new functions)
Line 10: Line 10:
 
  function RunOnLaunch()
 
  function RunOnLaunch()
 
   {
 
   {
   app.alert('Welcome to the Scribus Demo Form. This document wide script has been run while opening this PDF document. To see how it works, please open  the source file in Scribus and go to Edit/Javascripts and to File/Export/Save as PDF/Viewer/Special Actions. ');
+
   app.alert('Welcome to the Scribus Demo Form!');
  
 
  }
 
  }

Revision as of 21:59, 1 February 2008

edit
  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


Introduction

JavaScript functions in a PDF document

Adding new functions

Go to Edit/Javascripts... and click on Add. Choose a name for your new function and click on OK to launch a built-in JavaScript editor. Let us 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

Adding JavaScript to PDF form elements

Validate form fields

Calculate form field values

(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.