11# PDF customization
22
3- > [ !NOTE]
3+ > [ !NOTE]
44> All of these functions are available for ` HtmlPdfBuilder ` , ` UrlPdfBuilder ` and
5- > ` MarkdownPdfBuilder ` .
5+ > ` MarkdownPdfBuilder ` .
66> To customize ` LibreOfficePdfBuilder ` see the related [ documentation] ( office-builder.md ) .
77
88## Available functions
99
1010### Render
11- [ paperSize] ( #paperSize )
12- [ paperStandardSize] ( #paperStandardSize )
13- [ paperWidth] ( #paperWidth )
14- [ paperHeight] ( #paperHeight )
15- [ margins] ( #margins )
16- [ marginTop] ( #margins )
17- [ marginBottom] ( #margins )
18- [ marginLeft] ( #margins )
19- [ marginRight] ( #margins )
20- [ preferCssPageSize] ( #preferCssPageSize )
21- [ printBackground] ( #printBackground )
22- [ omitBackground] ( #omitBackground )
23- [ landscape] ( #landscape )
24- [ scale] ( #scale )
25- [ nativePageRanges] ( #nativePageRanges )
26- [ splitMode] ( #splitMode )
27- [ splitSpan] ( #splitSpan )
28- [ splitUnify] ( #splitUnify )
29-
30- ### Additional content
31- [ header and footer] ( #header-and-footer )
32- [ headerFile and footerFile] ( #headerfile-and-footerfile )
11+ [ paperSize] ( #paperSize )
12+ [ paperStandardSize] ( #paperStandardSize )
13+ [ paperWidth] ( #paperWidth )
14+ [ paperHeight] ( #paperHeight )
15+ [ margins] ( #margins )
16+ [ marginTop] ( #margins )
17+ [ marginBottom] ( #margins )
18+ [ marginLeft] ( #margins )
19+ [ marginRight] ( #margins )
20+ [ preferCssPageSize] ( #preferCssPageSize )
21+ [ printBackground] ( #printBackground )
22+ [ omitBackground] ( #omitBackground )
23+ [ landscape] ( #landscape )
24+ [ scale] ( #scale )
25+ [ nativePageRanges] ( #nativePageRanges )
26+ [ splitMode] ( #splitMode )
27+ [ splitSpan] ( #splitSpan )
28+ [ splitUnify] ( #splitUnify )
29+
30+ ### Additional content
31+ [ header and footer] ( #header-and-footer )
32+ [ headerFile and footerFile] ( #headerfile-and-footerfile )
3333[ download from] ( #download-from )
3434
3535### Style
36- [ assets] ( ../assets.md )
37- [ addAsset] ( ../assets.md )
36+ [ assets] ( ../assets.md )
37+ [ addAsset] ( ../assets.md )
3838
3939### Request
40- [ waitDelay] ( #waitDelay )
41- [ waitForExpression] ( #waitForExpression )
42- [ emulatedMediaType] ( #emulatedMediaType )
43- [ cookies] ( #cookies )
44- [ setCookie] ( #setCookie )
45- [ addCookies] ( #addCookies )
46- [ forwardCookie] ( #forwardCookie )
47- [ forwardAuthentication] ( #forwardAuthentication )
48- [ asUser] ( #asUser )
49- [ userAgent] ( #userAgent )
50- [ extraHttpHeaders] ( #extraHttpHeaders )
51- [ addExtraHttpHeaders] ( #addExtraHttpHeaders )
52- [ failOnHttpStatusCodes] ( #failOnHttpStatusCodes )
53- [ failOnResourceHttpStatusCodes] ( #failOnResourceHttpStatusCodes )
54- [ failOnResourceLoadingFailed] ( #failOnResourceLoadingFailed )
55- [ failOnConsoleExceptions] ( #failOnConsoleExceptions )
56- [ skipNetworkIdleEvent] ( #skipNetworkIdleEvent )
40+ [ waitDelay] ( #waitDelay )
41+ [ waitForExpression] ( #waitForExpression )
42+ [ emulatedMediaType] ( #emulatedMediaType )
43+ [ cookies] ( #cookies )
44+ [ setCookie] ( #setCookie )
45+ [ addCookies] ( #addCookies )
46+ [ forwardCookie] ( #forwardCookie )
47+ [ forwardAuthentication] ( #forwardAuthentication )
48+ [ asUser] ( #asUser )
49+ [ userAgent] ( #userAgent )
50+ [ extraHttpHeaders] ( #extraHttpHeaders )
51+ [ addExtraHttpHeaders] ( #addExtraHttpHeaders )
52+ [ failOnHttpStatusCodes] ( #failOnHttpStatusCodes )
53+ [ failOnResourceHttpStatusCodes] ( #failOnResourceHttpStatusCodes )
54+ [ failOnResourceLoadingFailed] ( #failOnResourceLoadingFailed )
55+ [ failOnConsoleExceptions] ( #failOnConsoleExceptions )
56+ [ skipNetworkIdleEvent] ( #skipNetworkIdleEvent )
5757
5858### Formatting
59- [ metadata] ( #metadata )
60- [ addMetadata] ( #addMetadata )
61- [ pdfFormat] ( #pdfFormat )
62- [ pdfUniversalAccess] ( #pdfUniversalAccess )
63- [ generateDocumentOutline] ( #generateDocumentOutline )
59+ [ metadata] ( #metadata )
60+ [ addMetadata] ( #addMetadata )
61+ [ pdfFormat] ( #pdfFormat )
62+ [ pdfUniversalAccess] ( #pdfUniversalAccess )
63+ [ generateDocumentOutline] ( #generateDocumentOutline )
6464[ generateTaggedPdf] ( #generateTaggedPdf )
6565
6666## Render
6969
7070Default: ` 8.5 inches x 11 inches `
7171
72- You can override the default paper size with ` height ` , ` width ` and ` unit ` .
72+ You can override the default paper size with ` height ` , ` width ` and ` unit ` .
7373` unit ` is optional but by default in inches.
7474
7575``` php
@@ -138,7 +138,7 @@ class MyInvoiceSize implements PaperSizeInterface
138138 {
139139 return 200;
140140 }
141-
141+
142142 public function unit(): Unit
143143 {
144144 return Unit::Inches;
@@ -150,7 +150,7 @@ class MyInvoiceSize implements PaperSizeInterface
150150
151151Default: ` 8.5 inches `
152152
153- You can override the default ` width ` and ` unit ` .
153+ You can override the default ` width ` and ` unit ` .
154154` unit ` is optional but by default in inches.
155155
156156``` php
@@ -182,7 +182,7 @@ class YourController
182182
183183Default: ` 11 inches `
184184
185- You can override the default ` height ` and ` unit ` .
185+ You can override the default ` height ` and ` unit ` .
186186` unit ` is optional but by default in inches.
187187
188188``` php
@@ -214,8 +214,8 @@ class YourController
214214
215215Default: ` 0.39 inches ` on all four sides
216216
217- You can override the default margins, with the arguments ` top ` , ` bottom ` , ` right ` ,
218- ` left ` and ` unit ` .
217+ You can override the default margins, with the arguments ` top ` , ` bottom ` , ` right ` ,
218+ ` left ` and ` unit ` .
219219` unit ` is optional but by default in inches.
220220
221221``` php
@@ -240,7 +240,7 @@ class YourController
240240}
241241```
242242
243- Or you can override all margins individually with respective ` unit ` .
243+ Or you can override all margins individually with respective ` unit ` .
244244` unit ` is always optional but by default in inches.
245245
246246``` php
@@ -524,7 +524,7 @@ class YourController
524524
525525## Additional content
526526
527- > [ !WARNING]
527+ > [ !WARNING]
528528> Every Header or Footer templates you pass to Gotenberg need to have
529529> the following structure.
530530> ``` html
@@ -540,7 +540,7 @@ class YourController
540540> </html >
541541> ```
542542>
543- > Some other limitations exist about header and footer.
543+ > Some other limitations exist about header and footer.
544544> For more information about [Header and Footer](https://gotenberg.dev/docs/routes#header-footer-chromium).
545545
546546### header and footer
@@ -577,9 +577,9 @@ class YourController
577577
578578### headerFile and footerFile
579579
580- > [ !WARNING]
580+ > [ !WARNING]
581581> As assets files, by default the HTML files are fetch in the assets folder of
582- > your application.
582+ > your application.
583583> If your HTML files are in another folder, you can override the default value
584584> of assets_directory in your configuration file config/sensiolabs_gotenberg.yml.
585585
@@ -629,7 +629,7 @@ class YourController
629629
630630### download from
631631
632- > [ !WARNING]
632+ > [ !WARNING]
633633> URL of the file. It MUST return a ` Content-Disposition ` header with a filename parameter.
634634
635635To download files resource from URLs.
@@ -655,7 +655,7 @@ class YourController
655655 ],
656656 [
657657 'url' => 'http://example.com/url/to/file',
658- 'extraHttpHeaders' =>
658+ 'extraHttpHeaders' =>
659659 [
660660 'MyHeaderOne' => 'MyValue',
661661 'MyHeaderTwo' => 'MyValue',
@@ -1090,7 +1090,7 @@ class YourController
10901090
10911091default: ` None `
10921092
1093- Return a 409 Conflict response if the HTTP status code from at least one resource
1093+ Return a 409 Conflict response if the HTTP status code from at least one resource
10941094is not acceptable.
10951095
10961096``` php
@@ -1122,7 +1122,7 @@ class YourController
11221122
11231123default: ` false `
11241124
1125- Return a 409 Conflict response if there are exceptions to load at least one resource
1125+ Return a 409 Conflict response if there are exceptions to load at least one resource
11261126in the Chromium.
11271127
11281128``` php
0 commit comments