Last change
on this file since 347 was 347, checked in by roby, 3 years ago |
Aggiornamento per compatibilità con php7.4
|
File size:
1.0 KB
|
Line | |
---|
1 | <?php
|
---|
2 | /**
|
---|
3 | * Html2Pdf Library - Tag class
|
---|
4 | *
|
---|
5 | * HTML => PDF converter
|
---|
6 | * distributed under the OSL-3.0 License
|
---|
7 | *
|
---|
8 | * @package Html2pdf
|
---|
9 | * @author Laurent MINGUET <webmaster@html2pdf.fr>
|
---|
10 | * @copyright 2017 Laurent MINGUET
|
---|
11 | */
|
---|
12 | namespace Spipu\Html2Pdf\Tag\Html;
|
---|
13 |
|
---|
14 | use Spipu\Html2Pdf\Tag\AbstractTag;
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * Tag Bookmark
|
---|
18 | */
|
---|
19 | class Bookmark extends AbstractTag
|
---|
20 | {
|
---|
21 | /**
|
---|
22 | * @inheritdoc
|
---|
23 | */
|
---|
24 | public function getName()
|
---|
25 | {
|
---|
26 | return 'bookmark';
|
---|
27 | }
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * @inheritdoc
|
---|
31 | */
|
---|
32 | public function open($properties)
|
---|
33 | {
|
---|
34 | $titre = isset($properties['title']) ? trim($properties['title']) : '';
|
---|
35 | $level = isset($properties['level']) ? floor($properties['level']) : 0;
|
---|
36 |
|
---|
37 | if ($level < 0) {
|
---|
38 | $level = 0;
|
---|
39 | }
|
---|
40 | if ($titre) {
|
---|
41 | $this->pdf->Bookmark($titre, $level, -1);
|
---|
42 | }
|
---|
43 |
|
---|
44 | return true;
|
---|
45 | }
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * @inheritdoc
|
---|
49 | */
|
---|
50 | public function close($properties)
|
---|
51 | {
|
---|
52 | // there is nothing to do here
|
---|
53 |
|
---|
54 | return true;
|
---|
55 | }
|
---|
56 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.