Skip to content

Commit 72508f8

Browse files
authored
Enhance readme with footer and paper size details (#8)
Updated instructions for changing footer and paper size using CSS @page rules.
1 parent eed48f9 commit 72508f8

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

readme.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,24 @@ You can chain the methods:
9696
return \WeasyPrint::loadFile('https://laravel.com/docs')->inline('laravel.pdf');
9797
```
9898

99-
You can change the orientation and paper size
99+
You can change the footer, orientation and paper size using the `@page` in you stylesheets
100100

101101
```php
102-
\WeasyPrint::loadHTML($html)->setPaper('a4')->setOrientation('landscape')->setOption('margin-bottom', 0)->save('myfile.pdf')
102+
@page {
103+
size: A4;
104+
margin: 1cm;
105+
@bottom-right{
106+
content: "Page " counter(page) " of " counter(pages);
107+
}
108+
}
109+
110+
```
111+
112+
```php
113+
@page {
114+
size: A6 landscape;
115+
margin: 1cm;
116+
}
103117
```
104118

105119
If you need the output as a string, you can get the rendered PDF with the output() function, so you can save/output it yourself.

0 commit comments

Comments
 (0)