Commit ed360e2eb57b39905f33508fe03714febfeb397b
1 parent
9d13742da4
pdflib_demo: linking from the second page to the first page works now
Showing 1 changed file with 13 additions and 6 deletions Side-by-side Diff
pdflib_demo
View file @
ed360e2
... | ... | @@ -59,9 +59,9 @@ |
59 | 59 | . "encoding=unicode "; |
60 | 60 | |
61 | 61 | $pdf->fit_textline("Jump to SSF for SHACK-10A", 20, 750, |
62 | - $textOpts . " underline=true"); | |
62 | + $textOpts); # . " underline=true matchbox={name=first_page}"); | |
63 | 63 | $pdf->fit_textline("This is some text on the first page; ", 20, 720, |
64 | - $textOpts); | |
64 | + $textOpts); # . " matchbox={name=first_page}"); | |
65 | 65 | $pdf->fit_textline("Привет! Этот немного текста.", 20, 690, $textOpts); |
66 | 66 | |
67 | 67 | // END PAGE 1 |
... | ... | @@ -76,6 +76,7 @@ |
76 | 76 | $ssfPage = $pdf->open_pdi_page($ssfPDF, 1, ''); |
77 | 77 | $ssfWidth = $pdf->pcos_get_number($ssfPDF, "pages[0]/width"); |
78 | 78 | $ssfHeight = $pdf->pcos_get_number($ssfPDF, "pages[0]/height"); |
79 | + //print "Page width/height: $ssfWidth x $ssfHeight\n"; | |
79 | 80 | |
80 | 81 | $pdf->begin_page_ext($ssfWidth, $ssfHeight, ''); |
81 | 82 | |
... | ... | @@ -87,10 +88,16 @@ |
87 | 88 | // for landscape mode... |
88 | 89 | //$pdf->fit_textline("Back to Top", 20, 570, |
89 | 90 | //$linkOpts = linkAttribs(1, 750); |
90 | - $optList = "destination={page=1 type=fixed left=0 top=750}"; | |
91 | - $action = $p->create_action("GoTo", $optList); | |
92 | - print_r($linkOpts); | |
93 | - $pdf->fit_textline("Back to Top", 20, 750, $linkOpts); | |
91 | + #$actionList = "destination={page=1 type=fixed left=0 top=750}"; | |
92 | + $actionList = "destination={page=1}"; | |
93 | + $action = $pdf->create_action("GoTo", $actionList); | |
94 | + $pdf->fit_textline("Back to Top", 20, $ssfHeight - 30, | |
95 | + $textOpts . " underline=true matchbox={name=first_page}"); | |
96 | + | |
97 | + // FIXME call create_annotation here | |
98 | + $optlist = "action={activate " . $action . "} linewidth=1 " . | |
99 | + "usematchbox={first_page}"; | |
100 | + $pdf->create_annotation(0, 0, 0, 0, "Link", $optlist); | |
94 | 101 | |
95 | 102 | // END PAGE 2 |
96 | 103 | $pdf->end_page_ext(''); |