Last change
on this file since 407 was 347, checked in by roby, 3 years ago |
Aggiornamento per compatibilità con php7.4
|
File size:
1.4 KB
|
Line | |
---|
1 | # Useful Methods
|
---|
2 |
|
---|
3 | [back](./README.md)
|
---|
4 |
|
---|
5 | ## Image Must Exist
|
---|
6 |
|
---|
7 | By default, if you try to use an image that Html2Pdf can not read, it will throw an `ImageException`.
|
---|
8 |
|
---|
9 | You can disable this test with the following method:
|
---|
10 |
|
---|
11 | ```php
|
---|
12 | $html2pdf->setTestIsImage(false);
|
---|
13 | ```
|
---|
14 |
|
---|
15 | If you disable the test, and if an image does not exist, it will display a 16x16 grey square instead.
|
---|
16 |
|
---|
17 | ## FallBack Image
|
---|
18 |
|
---|
19 | If you disable the "Image Must Exist" test, you can specify a fallback image with the following method:
|
---|
20 |
|
---|
21 | ```php
|
---|
22 | $html2pdf->setFallbackImage($imageFilename);
|
---|
23 | ```
|
---|
24 |
|
---|
25 | ## Can not split TD content
|
---|
26 |
|
---|
27 | By default, the content of a TD should not exceed one page.
|
---|
28 |
|
---|
29 | You can disable this protection with the following method:
|
---|
30 |
|
---|
31 | ```php
|
---|
32 | $html2pdf->setTestTdInOnePage(false);
|
---|
33 | ```
|
---|
34 |
|
---|
35 | **WARNING**:
|
---|
36 | If you disable this test, you may have big layouts problems on tables in multiple columns.
|
---|
37 |
|
---|
38 | Rather than disabling this test it is better to break the TD content in smaller ones.
|
---|
39 |
|
---|
40 | **We do not support the consequencies of disable this test.**
|
---|
41 |
|
---|
42 | ## Debug Mode
|
---|
43 |
|
---|
44 | You can enable a debug mode by using the following method:
|
---|
45 |
|
---|
46 | ```php
|
---|
47 | $html2pdf->setModeDebug();
|
---|
48 | ```
|
---|
49 |
|
---|
50 | You can specify your own debugger. It must implement `\Spipu\Html2Pdf\Debug\DebugInterface`.
|
---|
51 |
|
---|
52 | ```php
|
---|
53 | $debug = new \Spipu\Html2Pdf\Debug\Debug();
|
---|
54 | $html2pdf->setModeDebug($debug);
|
---|
55 | ```
|
---|
56 | ## Version
|
---|
57 |
|
---|
58 | You can get the current Html2Pdf version with the following methods:
|
---|
59 |
|
---|
60 | ```php
|
---|
61 | $html2pdf->getVersion();
|
---|
62 | $html2pdf->getVersionAsArray();
|
---|
63 | ```
|
---|
64 |
|
---|
65 | [back](./README.md)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.