[Scribus] JavaScripts with Scribus
MaHan
ma_han2000
Fri Mar 9 12:43:24 CET 2007
<quoting>
1)How can I in a Scribus pdf,with JavaScript highlight
a button onMouseOver,and onClick links to other
page.In html JavaScript I use 2 layers with images
that
show/hide.
I have 2 JavaScript functions that do it in html
JavaScript.
An example:
myFirstFunction () ;
mySecondFunction () ;
"JavaScript code invoking the above functions" ;
Can it work with PDF 1.5 (Acrobat 6) JavaScript?
</quoting>
At least for text fields and buttons, you can define
in the "Field Properties/Actions" tab javascript
actions to be performed on MouseOver, or MouseDown,
etc. E.g., you could change the text color of a button
on MouseOver, doing sth like this:
var fld = this.getField("name_of_your_button");
fld.textColor = ["RGB", 0.5, 0, 0.5];
Apart from the obligatory, but dull Acrobat JavaScript
Refererence, please check out this great collection of
examples:
http://www.acrobatusers.com/tech_corners/javascript_corner/tips/index.php?sort=true&search_keyword=All&submitButtonName=Go
Please mind though, that not everything will work
with Scribus, not yet:) You are very welcome to
discover what works and to share your experience with
other pdf form authors, e.g. writing some stuff for
our Scribus Wiki.
<quoting>
2)Is it possible to attach JavaScript functions to the
all Scribus document (top level)that can be called by
javascripts within the document,buttons etc?.For
performance and file size reasons.But embed INSIDE the
document and not in an external .js file.
</quoting>
Yes, it's possible. First, define your custom
JavaScript functions, e.g. "MyFirstFunction" in
Edit/JavaScripts -- they will be embedded inside the
PDF file. Then, call them from within your pdf form
items like buttons, text fields, combo boxes, etc,
defining the usual Actions (e.g. OnMouseDown
"MyFirstFunction();"), or using your functions in the
"Format" or "Calculate" tabs of the PDF Field
Properties.
Apart from that, you can launch such a document level
Javascript function on opening a PDF doc in Adobe
Reader, check the PDF Export dialog in Scribus for
further details.
hth
Maciej
___________________________________________________________
All New Yahoo! Mail ? Tired of unwanted email come-ons? Let our SpamGuard protect you. http://uk.docs.yahoo.com/nowyoucan.html
More information about the scribus
mailing list