10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

with a thin black border. Initially this is convenient for precise positioning, but we disabledthe border with linewidth=0.normalfont = p.load_font("Helvetica", "unicode", "");p.begin_page_ext(pagewidth, pageheight, "topdown");/* place the text line "Kraxi Systems, Inc." using a matchbox */String optlist ="font=" + normalfont + " fontsize=8 position={left top} " +"matchbox={name=kraxi} fillcolor={rgb 0 0 1} underline";p.fit_textline("Kraxi Systems, Inc.", 2, 20, optlist);/* create URI action */optlist = "url={http://www.kraxi.com}";int act = p.create_action("URI", optlist);/* create Link annotation on matchbox "kraxi" */optlist = "action={activate " + act + "} linewidth=0 usematchbox={kraxi}";/* 0 rectangle coordinates will be replaced with matchbox coordinates */p.create_annotation(0, 0, 0, 0, "Link", optlist);p.end_page_ext("");For an example of creating a Web link on an image or on parts of a textflow, see Section7.5, »Matchboxes«, page 177.Cookbook A full code sample can be found in the Cookbook topic interactive/link_annotations.Bookmark for jumping to another file. Now let’s create the bookmark »Our PaperPlanes Catalog« which jumps to another PDF file called paper_planes_catalog.pdf. Firstwe create an action of Type GoToR. In the option list for this action we define the nameof the target document with the filename option; the destination option specifies a certainpart of the page which will be enlarged. More precisely, the document will be displayedon the second page (page 2) with a fixed view (type fixed), where the middle of thepage is visible (left 50 top 200) and the zoom factor is 200% (zoom 2):String optlist ="filename=paper_planes_catalog.pdf " +"destination={page 2 type fixed left 50 top 200 zoom 2}";goto_action = p.create_action("GoToR", optlist);In the next step we create the actual bookmark. The action option for the bookmark containsthe activate event which will trigger the action, plus the goto_action handle createdabove for the desired action. The option fontstyle bold specifies bold text, and textcolor{rgb 0 0 1} makes the bookmark blue. The bookmark text »Our Paper Planes Catalog« isprovided as a function parameter:String optlist ="action={activate " + goto_action + "} fontstyle=bold textcolor={rgb 0 0 1}";catalog_bookmark = p.create_bookmark("Our Paper Planes Catalog", optlist);Clicking the bookmark will display the specified part of the page in the target document.68 Chapter 3: PDFlib Programming

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

Saved successfully!

Ooh no, something went wrong!