Commit 151c5c54bf748425d1bc2daa7083c6b191f9fb7a
1 parent
c3fc8ebc6c
Exists in
master
fpdfdemo: Added link back to the first page from the 2nd page
Showing 1 changed file with 12 additions and 6 deletions Side-by-side Diff
fpdfdemo
View file @
151c5c5
... | ... | @@ -35,16 +35,18 @@ |
35 | 35 | |
36 | 36 | // write out the contents of the first page |
37 | 37 | $pdf->AddPage(); |
38 | +$topLink = $pdf->AddLink(); | |
39 | +$pdf->SetLink($topLink); | |
38 | 40 | $pdf->SetFont('Arial', '', 20); |
39 | -$pdf->Write(10, "This is some text on the first page; "); | |
40 | 41 | $pdf->SetFont('', 'U'); |
41 | -$firstPageLink = $pdf->AddLink(); | |
42 | -$pdf->Write(10, "Click here to view the Site Summary Figure", $firstPageLink); | |
42 | +$ssfLink = $pdf->AddLink(); | |
43 | +$pdf->Write(10, "Jump SSF for SHACK-10A", $ssfLink); | |
43 | 44 | $pdf->SetFont(''); |
44 | 45 | $pdf->Ln(); |
46 | +$pdf->Write(10, "This is some text on the first page; "); | |
47 | +$pdf->Ln(); | |
45 | 48 | $pdf->Write(10, "Привет! Этот немного текста."); |
46 | 49 | |
47 | - | |
48 | 50 | // load up the Site Summary Figure to go on page #2 |
49 | 51 | $ssfPageCount = $pdf->setSourceFile(__DIR__ . '/site_summary_figure.pdf'); |
50 | 52 | |
51 | 53 | |
... | ... | @@ -58,11 +60,15 @@ |
58 | 60 | |
59 | 61 | // add the SSF file to the 2nd page |
60 | 62 | $pdf->AddPage(); |
61 | -$pdf->SetLink($firstPageLink); | |
63 | +$pdf->SetLink($ssfLink); | |
62 | 64 | $pdf->useTemplate($ssfTemplate); |
63 | 65 | $pdf->SetFont('Helvetica'); |
64 | 66 | $pdf->SetXY(5,5); |
65 | -$pdf->Write(8, "This is some text on the Site Summary Figure"); | |
67 | +$pdf->SetFont('', 'U'); | |
68 | +$pdf->Write(8, "Top", $topLink); | |
69 | +$pdf->SetFont(''); | |
70 | +$pdf->SetXY(40, 5); | |
71 | +$pdf->Write(8, " SSF: P771/SHACK-10A"); | |
66 | 72 | |
67 | 73 | // destination, F = "local file"; filename; isUTF8 (boolean) |
68 | 74 | //$pdf->Output('F', 'output.pdf', TRUE); |