1
1
# Dynamic PDF Plugin
2
2
3
- ** Demo URL:** https://october-demo.renatio.com/backend/backend/auth/signin
4
- ** Login:** dynamicpdf
3
+ ** Demo URL:** https://october-demo.renatio.com/backend/backend/auth/signin
4
+
5
+ ** Login:** dynamicpdf
6
+
5
7
** Password:** dynamicpdf
6
8
7
9
This plugin allows developers to create and edit PDF templates with a simple user interface.
@@ -27,9 +29,11 @@ Please check my other [plugins](https://octobercms.com/author/Renatio).
27
29
Please use [ GitHub Issues Page] ( https://github.com/mplodowski/dynamicpdf-plugin/issues ) to report any issues with
28
30
plugin.
29
31
30
- > Reviews should not be used for getting support or reporting bugs, if you need support please use the Plugin support link.
32
+ > Reviews should not be used for getting support or reporting bugs, if you need support please use the Plugin support
33
+ > link.
31
34
32
- Icon made by [ Darius Dan] ( https://www.flaticon.com/authors/darius-dan ) from [ www.flaticon.com ] ( https://www.flaticon.com/ ) .
35
+ Icon made by [ Darius Dan] ( https://www.flaticon.com/authors/darius-dan )
36
+ from [ www.flaticon.com ] ( https://www.flaticon.com/ ) .
33
37
34
38
# Documentation
35
39
@@ -117,9 +121,9 @@ name = "Default PDF layout"
117
121
118
122
The configuration section sets the PDF view parameters. The following configuration parameters are supported:
119
123
120
- Parameter | Description
121
- ------------- | -------------
122
- ** name** | the layout name, required.
124
+ | Parameter | Description |
125
+ | -----------| -- -------------------------- |
126
+ | ** name** | the layout name, required. |
123
127
124
128
### Using PDF layouts
125
129
@@ -160,20 +164,21 @@ orientation = "portrait"
160
164
161
165
The configuration section sets the PDF view parameters. The following configuration parameters are supported:
162
166
163
- Parameter | Description
164
- ------------- | -------------
165
- ** title** | the template title, required.
166
- ** layout** | the layout code, optional.
167
- ** description** | the template description, optional.
168
- ** size** | the template paper size, optional, default ` a4 ` .
169
- ** orientation** | the template paper orientation, optional, default ` portrait ` .
167
+ | Parameter | Description |
168
+ | ----------------- | --------------------------------------------------------------- |
169
+ | ** title** | the template title, required. |
170
+ | ** layout** | the layout code, optional. |
171
+ | ** description** | the template description, optional. |
172
+ | ** size** | the template paper size, optional, default ` a4 ` . |
173
+ | ** orientation** | the template paper orientation, optional, default ` portrait ` . |
170
174
171
175
### Using PDF templates
172
176
173
177
PDF templates reside in the database and can be created in the back-end area via * Settings > PDF > PDF Templates* .
174
178
The ** code** specified in the template is a unique identifier and cannot be changed once created.
175
179
176
- > ** Note:** If the PDF template does not exist in the system, this code will attempt to find a PDF view with the same code.
180
+ > ** Note:** If the PDF template does not exist in the system, this code will attempt to find a PDF view with the same
181
+ > code.
177
182
178
183
## Registering PDF templates and layouts
179
184
@@ -272,21 +277,21 @@ See [Dompdf\Options](https://github.com/dompdf/dompdf/blob/master/src/Options.ph
272
277
273
278
## Methods
274
279
275
- | Method | Description |
276
- | ---| ---|
277
- | loadTemplate($code, array $data = [ ] , $encoding = null) | Load backend template |
278
- | loadLayout($code, array $data = [ ] , $encoding = null) | Load backend layout |
279
- | loadHTML($string, $encoding = null) | Load HTML string |
280
- | loadFile($file) | Load HTML string from a file |
281
- | parseTemplate(Template $template, array $data = [ ] ) | Parse backend template using Twig |
282
- | parseLayout(Layout $layout, array $mergeData = [ ] ) | Parse backend layout using Twig |
283
- | getDomPDF() | Get the DomPDF instance |
284
- | setPaper($paper, $orientation = 'portrait') | Set the paper size and orientation (default A4/portrait) |
285
- | setWarnings($warnings) | Show or hide warnings |
286
- | output() | Output the PDF as a string |
287
- | save($filename) | Save the PDF to a file |
288
- | download($filename = 'document.pdf') | Make the PDF downloadable by the user |
289
- | stream($filename = 'document.pdf') | Return a response with the PDF to show in the browser |
280
+ | Method | Description |
281
+ | --------------------------------------------------------- | ------------------------------------------------------- ---|
282
+ | loadTemplate($code, array $data = [ ] , $encoding = null) | Load backend template |
283
+ | loadLayout($code, array $data = [ ] , $encoding = null) | Load backend layout |
284
+ | loadHTML($string, $encoding = null) | Load HTML string |
285
+ | loadFile($file) | Load HTML string from a file |
286
+ | parseTemplate(Template $template, array $data = [ ] ) | Parse backend template using Twig |
287
+ | parseLayout(Layout $layout, array $mergeData = [ ] ) | Parse backend layout using Twig |
288
+ | getDomPDF() | Get the DomPDF instance |
289
+ | setPaper($paper, $orientation = 'portrait') | Set the paper size and orientation (default A4/portrait) |
290
+ | setWarnings($warnings) | Show or hide warnings |
291
+ | output() | Output the PDF as a string |
292
+ | save($filename) | Save the PDF to a file |
293
+ | download($filename = 'document.pdf') | Make the PDF downloadable by the user |
294
+ | stream($filename = 'document.pdf') | Return a response with the PDF to show in the browser |
290
295
291
296
All methods are available through Facade class ` Renatio\DynamicPDF\Classes\PDF ` .
292
297
@@ -383,7 +388,8 @@ Recommended approach is to save PDF file locally and return redirect to PDF file
383
388
384
389
### Page numbers
385
390
386
- Page numbers can be generated using PHP. Inline PHP is disabled by default, because it can be a security risk. You can enable inline PHP using ` setIsPhpEnabled ` method.
391
+ Page numbers can be generated using PHP. Inline PHP is disabled by default, because it can be a security risk. You can
392
+ enable inline PHP using ` setIsPhpEnabled ` method.
387
393
388
394
```
389
395
return PDF::loadTemplate('renatio::invoice')
0 commit comments