Adding Hyperlinks to your Scribus PDF document: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
No edit summary
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{TIP Index}}
===Method A===
* go to the PDF toolbar, select '''PDF Annotation > Link''', and draw with it a rectangle above an element (e.g. a text frame) you wish to become a hyperlink
* right click on the new rectangle and select '''PDF Options > Annotation Properties''' from the context menu
* in the annotation properties dialog, choose '''External Web-Link''' as annotation type and insert your URL into the '''Destination''' field
* done!
===Method B===
* Open your Scribus document.
* Open your Scribus document.
* Click the "OK" button for "Insert PDF fields".
* Click the "OK" button for "Insert PDF fields".
Line 7: Line 19:
* From the Type pull-down menu, choose JavaScript.
* From the Type pull-down menu, choose JavaScript.
* To the right of the Script box, click Edit.
* To the right of the Script box, click Edit.
* Enter the following: <tt>app.launchURL("http://www.scribus.net/", true);</tt>
* Enter the following: <tt>app.launchURL("<nowiki>http://www.scribus.net/</nowiki>", true);</tt>
* Click File/Save and Exit.
* Click File/Save and Exit.
* Click OK.
* Click OK.
Line 14: Line 26:
If you now open that PDF version in a browser, you will find those text (and/or graphics) areas linkable. The "true" parameter in the JavaScript is important so a new frame (window or tab) is opened for the link. This way your PDF document remains open and available in its original frame.
If you now open that PDF version in a browser, you will find those text (and/or graphics) areas linkable. The "true" parameter in the JavaScript is important so a new frame (window or tab) is opened for the link. This way your PDF document remains open and available in its original frame.


References:
====Variation on Method B====
If you want to create a link to an email address, modify the JavaScript above like this:
* <tt>app.launchURL(<nowiki>"mailto:youraddress@yourISP.com"</nowiki>, true);</tt>
 
This is dependent on having the preset link to the appropriate email client.
 
== References ==
* [http://docs.scribus.net/content/en/pdfs/javascriptpdf.pdf Javascripting PDF in Scribus] - see page 3 on creating a  web button link. This solution goes halfway but fails to open the link in a new frame.
* [http://docs.scribus.net/content/en/pdfs/javascriptpdf.pdf Javascripting PDF in Scribus] - see page 3 on creating a  web button link. This solution goes halfway but fails to open the link in a new frame.
* [http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJS.pdf Adobe Acrobat JavaScript Manual] - see page 114 on the launchURL function. This allows the added parameter that completes the solution.
* [http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJS.pdf Adobe Acrobat JavaScript Manual] - see page 114 on the launchURL function. This allows the added parameter that completes the solution.

Revision as of 21:36, 9 March 2008

This article is part of the Tips & Tricks series.
Installation Usage PDF issues Other

Method A

  • go to the PDF toolbar, select PDF Annotation > Link, and draw with it a rectangle above an element (e.g. a text frame) you wish to become a hyperlink
  • right click on the new rectangle and select PDF Options > Annotation Properties from the context menu
  • in the annotation properties dialog, choose External Web-Link as annotation type and insert your URL into the Destination field
  • done!

Method B

  • Open your Scribus document.
  • Click the "OK" button for "Insert PDF fields".
  • Make a box to surround the text and/or graphics from which you want to create a hyperlink.
  • Double click this box, which opens the Field Properties dialogue box.
  • In the Appearance tab, choose "None" for colour of the border (unless you really want a border added).
  • Click on the Action tab.
  • From the Type pull-down menu, choose JavaScript.
  • To the right of the Script box, click Edit.
  • Enter the following: app.launchURL("http://www.scribus.net/", true);
  • Click File/Save and Exit.
  • Click OK.
  • Save your .sla document and export it to PDF format.

If you now open that PDF version in a browser, you will find those text (and/or graphics) areas linkable. The "true" parameter in the JavaScript is important so a new frame (window or tab) is opened for the link. This way your PDF document remains open and available in its original frame.

Variation on Method B

If you want to create a link to an email address, modify the JavaScript above like this:

  • app.launchURL("mailto:youraddress@yourISP.com", true);

This is dependent on having the preset link to the appropriate email client.

References