Skip to content

Commit

Permalink
add Result
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Beru committed Jul 3, 2024
1 parent d589e1d commit 76e3c94
Show file tree
Hide file tree
Showing 35 changed files with 270 additions and 193 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class YourController
{
return $gotenberg->url()
->url('https://sensiolabs.com/fr/')
->generate() // will return directly a stream response
->build() // will return directly a stream response
;
}
}
Expand Down Expand Up @@ -107,7 +107,7 @@ class YourController
->content('twig_simple_pdf.html.twig', [
'my_var' => 'value'
])
->generate() // will return directly a stream response
->build() // will return directly a stream response
;
}
}
Expand Down Expand Up @@ -165,7 +165,7 @@ class YourController
{
return $gotenberg->url()
->url('https://sensiolabs.com/fr/')
->generate()
->build()
;
}
}
Expand All @@ -191,7 +191,7 @@ class YourController
->content('twig_simple_pdf.html.twig', [
'my_var' => 'value'
])
->generate()
->build()
;
}
}
Expand Down
8 changes: 4 additions & 4 deletions docs/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ And in your controller nothing needs to be changed.
{
return $gotenberg->html()
->content('twig_simple_pdf.html.twig')
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -138,7 +138,7 @@ All you need to do is to add the path of the asset file to either `assets(...str
'img/ceo.jpeg',
'img/admin.jpeg'
)
->generate()
->build()
;
}
}
Expand All @@ -161,7 +161,7 @@ Relative path work as well.
'../img/ceo.jpeg',
'../img/admin.jpeg'
)
->generate()
->build()
;
}
}
Expand All @@ -186,7 +186,7 @@ You can do it with `addAsset()` function to add an asset to the current asset li
'../img/admin.jpeg'
)
->addAsset('../img/developer.jpeg')
->generate()
->build()
;
}
}
Expand Down
7 changes: 3 additions & 4 deletions docs/pdf/convert-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ You may have the possibility to convert several PDF document.
> [!WARNING]
> If you provide multiple PDF files you will get ZIP folder containing all the converted PDF.

```php
namespace App\Controller;

Expand All @@ -28,7 +27,7 @@ You may have the possibility to convert several PDF document.
'document.pdf',
'document_2.pdf',
)
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -58,7 +57,7 @@ Convert the resulting PDF into the given PDF/A format.
'document_2.pdf',
)
->pdfFormat(PdfFormat::Pdf1b)
->generate()
->build()
;
}
}
Expand All @@ -85,7 +84,7 @@ Enable PDF for Universal Access for optimal accessibility.
'document_2.pdf',
)
->pdfUniversalAccess() // is same as `->pdfUniversalAccess(true)`
->generate()
->build()
;
}
}
Expand Down
60 changes: 30 additions & 30 deletions docs/pdf/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ You can override the default paper size with `height`, `width` and `unit`.
'my_var' => 'value'
])
->paperSize(21, 29.7, Unit::Centimeters)
->generate()
->build()
;
}
}
Expand All @@ -102,7 +102,7 @@ You can override the default paper size with standard paper size.
'my_var' => 'value'
])
->paperStandardSize(PaperSize::A4)
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -154,7 +154,7 @@ You can override the default `width` and `unit`.
'my_var' => 'value'
])
->paperWidth(15, Unit::Inches)
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -185,7 +185,7 @@ You can override the default `height` and `unit`.
'my_var' => 'value'
])
->paperHeight(15, Unit::Inches)
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -217,7 +217,7 @@ You can override the default margins, with the arguments `top`, `bottom`, `right
'my_var' => 'value'
])
->margins(1, 2, 3, 4, Unit::Inches)
->generate()
->build()
;
}
}
Expand All @@ -244,7 +244,7 @@ Or you can override all margins individually with respective `unit`.
->marginBottom(4, Unit::Pixels)
->marginLeft(4, Unit::Picas)
->marginRight(4, Unit::Millimeters)
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -273,7 +273,7 @@ Define whether to prefer page size as defined by CSS.
'my_var' => 'value'
])
->preferCssPageSize()
->generate()
->build()
;
}
}
Expand All @@ -299,7 +299,7 @@ Print the background graphics.
'my_var' => 'value'
])
->printBackground()
->generate()
->build()
;
}
}
Expand All @@ -325,7 +325,7 @@ Hide the default white background and allow generating PDFs with transparency.
'my_var' => 'value'
])
->omitBackground()
->generate()
->build()
;
}
}
Expand All @@ -351,7 +351,7 @@ Set the paper orientation to landscape.
'my_var' => 'value'
])
->landscape()
->generate()
->build()
;
}
}
Expand All @@ -377,7 +377,7 @@ The scale of the page rendering.
'my_var' => 'value'
])
->scale(2.5)
->generate()
->build()
;
}
}
Expand All @@ -403,7 +403,7 @@ Page ranges to print, e.g., '1-5, 8, 11-13' - empty means all pages.
'my_var' => 'value'
])
->nativePageRanges('1-5')
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -454,7 +454,7 @@ to your generated PDF.
->footer('footer.html.twig', [
'my_var' => 'value'
])
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -482,7 +482,7 @@ to your generated PDF.
->headerFile('header.html')
->contentFile('content.html')
->footerFile('footer.html')
->generate()
->build()
;
}
}
Expand All @@ -504,7 +504,7 @@ Relative path work as well.
->headerFile('../templates/html/header.html')
->contentFile('../templates/html/content.html')
->footerFile('../templates/html/footer.html')
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -536,7 +536,7 @@ generate.
'my_var' => 'value'
])
->waitDelay('5s')
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -564,7 +564,7 @@ You may also wait until a given JavaScript expression.
'my_var' => 'value'
])
->waitForExpression("window.globalVar === 'ready'")
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -596,7 +596,7 @@ you to force the \"standard\" CSS rules.
'my_var' => 'value'
])
->emulatedMediaType(EmulatedMediaType::Screen)
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -632,7 +632,7 @@ Cookies to store in the Chromium cookie jar.
'httpOnly' => true,
'sameSite' => 'Lax',
]])
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -668,7 +668,7 @@ configuration .
'httpOnly' => true,
'sameSite' => 'Lax',
])
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -701,7 +701,7 @@ configuration.
'httpOnly' => true,
'sameSite' => 'Lax',
]])
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -730,7 +730,7 @@ HTTP headers to send by Chromium while loading the HTML document.
->extraHttpHeaders([
'MyHeader' => 'MyValue'
])
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -763,7 +763,7 @@ configuration.
->addExtraHttpHeaders([
'MyHeader' => 'MyValue'
])
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -791,7 +791,7 @@ page is not acceptable.
'my_var' => 'value'
])
->failOnHttpStatusCodes([401, 403])
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -822,7 +822,7 @@ console.
'my_var' => 'value'
])
->failOnConsoleExceptions()
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -855,7 +855,7 @@ field to true can greatly enhance the conversion speed.
'my_var' => 'value'
])
->skipNetworkIdleEvent()
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -887,7 +887,7 @@ Resets the configuration metadata and add new ones to write.
'my_var' => 'value'
])
->metadata(['Author' => 'SensioLabs', 'Subject' => 'Gotenberg'])
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -917,7 +917,7 @@ If you want to add metadata from the ones already loaded in the configuration.
'my_var' => 'value'
])
->addMetadata('key', 'value')
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -947,7 +947,7 @@ configuration.
'my_var' => 'value'
])
->pdfFormat(PdfFormat::Pdf1b)
->generate()
->build()
;
}
}
Expand Down Expand Up @@ -977,7 +977,7 @@ Enable PDF for Universal Access for optimal accessibility.
'my_var' => 'value'
])
->pdfUniversalAccess()
->generate()
->build()
;
}
}
Expand Down
Loading

0 comments on commit 76e3c94

Please sign in to comment.