If you have attempted the previous PDF how-to’s, you will be aware that you can create some powerful forms by using Scribus and Acrobat Reader. Unfortunately, Adobe has put restrictions on Reader so that it does not have all the capabilities of Acrobat Professional. However, there are many useful features still available, especially with using JavaScript to make Scribus PDF forms very useful.
The Adobe Web Site has two free references available on JavaScripting:
function date() var fld = this.getField("DateField"); fld.value = util.printd("dd mmmm yyyy",new Date()); > date(); // call my function
To place this function, select Edit - > JavaScripts -> Add in Scribus menu.
You can cut and paste the code from this page. There must be a Text Field on the page named DateField.
function Year() < var fld1 = this.getField("Year"); fld1.value = util.printd("yyyy",new Date()); >Year(); // call my function
To place this function, on Menu select Edit - > JavaScripts -> Add
You can cut and paste the code from this page. There must be a Text Field on the page named Year
function HideView() < var title = this.getField("zzztext"); title.display = display.noView; >HideView();// call my function
To place this function, on Menu select Edit - > JavaScripts -> Add
You can cut and paste the code from this page. There must be a Text Field on the page named zzztext
Create a Button Field
Right click with your mouse on the “Print” Button
A menu pops up and select PDF Options –> Field Properties
Next select the Action Tab –> choose JavaScript and then in the default Mouse Up event -
Click on Edit and insert the following:
var pp = this.getPrintParams(); pp.interactive = pp.constants.interactionLevel.silent; pp.printContent = pp.constants.printContents.formFieldsOnly; this.print(pp);
function Print() < var oDate = new Date(); // get the current date time object var sDate = util.printd("mm/dd/yyyy h:mm t" , oDate); // format date time string this.getField("TimePrint").value = "Printed: " + sDate + "m"; // fillin the field value >Print();// call my function
To place this function, on Menu select Edit - > JavaScripts -> Add
You can cut and paste the code from this page. There must be a Text Field on the page named TimePrint.
You will also need to create a HideView function for the TimePrint Field some that the field is hidden from view until the document is printed.
one two three