10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.4 Interactive ElementsCookbook Code samples regarding interactive element issues can be found in the interactive categoryof the PDFlib Cookbook.3.4.1 Examples for Creating Interactive ElementsThis section explains how to create interactive elements such as bookmarks, formfields, and annotations. Figure 3.1 shows the resulting document with all interactive elementsthat we will create in this section. The document contains the following interactiveelements:> At the top right there is an invisible Web link to www.kraxi.com at the textwww.kraxi.com. Clicking this area will bring up the corresponding Web page.> A gray form field of type text is located below the Web link. Using JavaScript code itwill automatically be filled with the current date.> The red pushpin contains an annotation with an attachment. Clicking it will openthe attached file.> At the bottom left there is a form field of type button with a printer symbol. Clickingthis button will execute Acrobat’s menu item File, Print.> The navigation page contains the bookmark »Our Paper Planes Catalog«. Clickingthis bookmark will bring up a page of another PDF document.In the next paragraphs we will show in detail how to create these interactive elementswith PDFlib.Web link. Let’s start with a link to the Web site www.kraxi.com. This is accomplished inthree steps. First, we fit the text on which the Web link should work. Using the matchboxoption with name=kraxi we specify the rectangle of the text’s fitbox for further reference.Second, we create an action of type URI (in Acrobat: Open a web link). This will provideus with an action handle which subsequently can be assigned to one or more interactiveelements.Third, we create the actual link. A link in PDF is an annotation of type Link. The actionoption for the link contains the event name activate which will trigger the action, plusthe act handle created above for the action itself. By default the link will be displayedFig. 3.1Document with interactiveelements3.4 Interactive Elements 67

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!