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.

esult = p.fit_textflow(tflow, 0, 0, 50, 70, "fitmethod=auto");if (!result.equals("_stop")){ /* ... */ }/* create URI action */optlist = "url={http://www.kraxi.com}";act = p.create_action("URI", optlist);/* create Link annotation on matchbox "kraxi" */optlist = "action={activate " + act + "} linewidth=0 usematchbox={kraxi}";p.create_annotation(0, 0, 0, 0, "Link", optlist);Even if the text Kraxi Systems, Inc. spans several lines the appropriate number of link annotationswill be created automatically with a single call to PDF_create_annotation( ).The result in shown in Figure 7.47.For information aboutGiant Wing PaperPlanes see the Website of Kraxi Systems,Inc.Fig. 7.47Add Weblinks to parts of a Textflow7.5.3 Matchboxes and ImagesAdding a Web link to an image. To add a Web link to the area covered by an image theimage matchbox can be used. The code is similar to »Adding a Web link to the Textflowmatchbox«, page 178, above. However, instead of placing the Textflow, fit the image usingthe following option list:String optlist = "boxsize={130 130} fitmethod=meet matchbox={name=kraxi}";p.fit_image(image, 10, 10, optlist);Cookbook A full code sample can be found in the Cookbook topic interactive/link_annotations.Drawing a frame around an image. In this example we want to use the image matchboxto draw a frame around the image. We completely fit the image into the suppliedbox while maintaining its proportions using fitmethod=meet. We use the matchbox optionwith the borderwidth suboption to draw a thick border around the image. Thestrokecolor suboption determines the border color, and the linecap and linejoin suboptionsare used to round the corners.Cookbook A full code sample can be found in the Cookbook topic images/frame_around_image.The matchbox is always drawn before the image which means it would be partially hiddenby the image. To avoid this we use the offset suboptions with 50 percent of the borderwidth to enlarge the frame beyond the area covered by the image. Alternatively, wecould increase the border with accordingly. Figure 7.48 shows the option list used withPDF_fit_image( ) to draw the frame.7.5 Matchboxes 179

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

Saved successfully!

Ooh no, something went wrong!