source: trunk/client/inc/hpdf5/spipu/html2pdf/doc/tcpdf_methods.md@ 347

Last change on this file since 347 was 347, checked in by roby, 3 years ago

Aggiornamento per compatibilità con php7.4

File size: 4.2 KB
Line 
1# TCPDF Methods
2
3[back](./README.md)
4
5All the TCPDF methods can be used, by using the `pdf` property:
6
7```php
8$html2pdf->pdf->...
9```
10
11## Display Mode
12
13You can change how your PDF document will be displayed, with the `SetDisplayMode` method:
14
15```php
16$html2pdf = new \Spipu\Html2Pdf\Html2Pdf('P', 'A4', 'en');
17$html2pdf->pdf->SetDisplayMode('fullpage');
18$html2pdf->writeHTML($htmlContent);
19$html2pdf->output();
20```
21
22The parameters are:
23
24Parameter| Default | Description
25---------|---------|-------------
26$zoom | | The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use. <ul><li>fullpage: displays the entire page on screen </li><li>fullwidth: uses maximum width of window</li><li>real: uses real size (equivalent to 100% zoom)</li><li>default: uses viewer default mode</li></ul>
27$layout | SinglePage | The page layout. Possible values are:<ul><li>SinglePage Display one page at a time</li><li>OneColumn Display the pages in one column</li><li>TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left</li><li>TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right</li><li>TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left</li><li>TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right</li></ul>
28$mode | UseNone | A name object specifying how the document should be displayed when opened:<ul><li>UseNone Neither document outline nor thumbnail images visible</li><li>UseOutlines Document outline visible</li><li>UseThumbs Thumbnail images visible</li><li>FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible</li><li>UseOC (PDF 1.5) Optional content group panel visible</li><li>UseAttachments (PDF 1.6) Attachments panel visible</li></ul>
29
30## Document Information
31
32You can change the document information, with the following methods:
33
34```php
35$html2pdf = new \Spipu\Html2Pdf\Html2Pdf('P', 'A4', 'en');
36$html2pdf->pdf->SetAuthor('LAST-NAME Frist-Name');
37$html2pdf->pdf->SetTitle('My Pdf Document');
38$html2pdf->pdf->SetSubject('it will be about something important');
39$html2pdf->pdf->SetKeywords('example, keywords, others');
40$html2pdf->writeHTML($htmlContent);
41$html2pdf->output();
42```
43
44## Document Protection
45
46You can protect your PDF document, with the `setProtection` method:
47
48```php
49$html2pdf->pdf->SetProtection($permissions, $userPass, $ownerPass, $mode, $pubkeys);
50```
51
52The parameters are:
53
54Parameter| Default | Description
55---------|---------|-------------
56$permissions | | the set of permissions (specify the ones you want to block):<ul><li>print : Print the document;</li><li>modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';</li><li>copy : Copy or otherwise extract text and graphics from the document;</li><li>annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);</li><li>fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;</li><li>extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);</li><li>assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;</li><li>print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.</li><li>owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.</li></ul>
57$userPass | | user password. Empty by default.
58$ownerPass | null | owner password. If not specified, a random value is used.
59$mode | 0 | encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit.
60$pubkeys | null| array of recipients containing public-key certificates ('c') and permissions ('p'). For example: array(array('c' => 'file://../examples/data/cert/tcpdf.crt', 'p' => array('print')))
61
62[back](./README.md)
Note: See TracBrowser for help on using the repository browser.