Download the PHP package sensiolabs/gotenberg-bundle without Composer

On this page you can find all versions of the php package sensiolabs/gotenberg-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gotenberg-bundle

Gotenberg Bundle

Latest Version Total Downloads Monthly Downloads Static analysis Tests

[!WARNING]
This Bundle is experimental and subject to change in a future release.

What is it ?

This bundle allows you to generate, stream and save PDF locally from URL, HTML, Markdown or any Office file. Different options are available depending on the source.

It also helps you to generate, stream and save images locally from URL, HTML and Markdown using a screenshot.

How to install

Install the bundle using composer :

With Symfony Flex

If you accept the Symfony Flex recipe during installation, the bundle is registered, the configuration skeleton file is created, the .env file is updated with GOTENBERG_DSN and dockerfile is also created to get the gotenberg image, you need to configure the ports related to GOTENBERG_DSN in your .env file.
The host could be updated too since it's localhost by default. If your script is run in a container, the host will be gotenberg.

You can now adapt the configuration file to your needs.

Without Symfony Flex

[!CAUTION] To use this bundle, you first need to install and configure Gotenberg 8.x.

Enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

Basic Usage

PDF

You can generate a PDF locally from URL, HTML, Markdown or any Office files.

URL

After injecting GotenbergPdfInterface you simply need to call the method url, which will return a UrlPdfBuilder instance.

UrlPdfBuilder lets you pass the URL of the page you want to convert into PDF to the method url.

[!TIP] For more information go to Gotenberg documentations.

Twig

[!WARNING]
Every twig templates you pass to Gotenberg need to have the following structure.
Even Header or Footer parts.

If a template needs to link to a static asset (e.g. an image), this bundle provides a {{ gotenberg_asset() }} Twig function to generate the correct path AND add it to the builder automatically.

This function work as asset() Twig function and fetch your assets in the assets folder of your application If your files are in another folder, you can override the default value of assets_directory in your configuration file config/sensiolabs_gotenberg.yml. The path provided can be relative as well as absolute.

[!TIP] For more information go to Gotenberg documentations.

Screenshot

You can generate a screenshot locally from URL, HTML and Markdown.

URL

After injecting GotenbergScreenshotInterface you simply need to call the method url, which will return a UrlScreenshotBuilder instance.

UrlScreenshotBuilder lets you pass the URL of the page you want to convert into screenshot to the method url.

Twig

After injecting GotenbergScreenshotInterface you simply need to call the method html, which will return a HtmlScreenshotBuilder instance.

HtmlScreenshotBuilder lets you pass the content of the page you want to convert into screenshot to the method content.

[!TIP] For more information go to Gotenberg documentations.

Advanced Usage

  1. Configuration
  2. Working with assets
  3. Builders API

PDF

  1. Add header / footer
  2. HTML Builder
  3. Markdown Builder
  4. Url Builder
  5. Office Builder (available extensions for conversion below)
    123, 602, abw, bib, bmp, cdr, cgm, cmx, csv, cwk, dbf, dif, doc, docm, docx, dot, dotm, dotx, dxf, emf, eps, epub, fodg, fodp, fods, fodt, fopd, gif, htm, html, hwp, jpeg, jpg, key, ltx, lwp, mcw, met, mml, mw, numbers, odd, odg, odm, odp, ods, odt, otg, oth, otp, ots, ott, pages, pbm, pcd, pct, pcx, pdb, pdf, pgm, png, pot, potm, potx, ppm, pps, ppt, pptm, pptx, psd, psw, pub, pwp, pxl, ras, rtf, sda, sdc, sdd, sdp, sdw, sgl, slk, smf, stc, std, sti, stw, svg, svm, swf, sxc, sxd, sxg, sxi, sxm, sxw, tga, tif, tiff, txt, uof, uop, uos, uot, vdx, vor, vsd, vsdm, vsdx, wb2, wk1, wks, wmf, wpd, wpg, wps, xbm, xhtml, xls, xlsb, xlsm, xlsx, xlt, xltm, xltx, xlw, xml, xpm, zabw
  6. Merge Builder
  7. Convert Builder
  8. PDF customization (available for every builder except LibreOffice and Merge)

Screenshot

  1. HTML Builder
  2. Markdown Builder
  3. Url Builder
  4. Screenshot customization

Profiler

Comes with a built-in profiler panel to help you during your development.

Credits

This bundle was inspired by Gotenberg PHP.

Licence

MIT License (MIT): see the License File for more details.

FAQ

My PDF / Screenshot is blank but I have no errors ! It may be because Gotenberg is trying to access an invalid URL (when using the `->url()` or `->route()` modes). For example if Gotenberg tries to access a page on `https://localhost:8001` but the SSL is a local provided one. Then Chromium won't be able to authorize access to the website. To fix this you can update your Gotenberg docker service as followed : It can also be because from Gotenberg PoV the URL of your Symfony app is not reachable. Let's say you are using [symfony CLI](https://symfony.com/download) to run your project locally with Gotenberg running in Docker. You need to configure the request_context like so :

All versions of gotenberg-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
psr/container Version ^2.0
psr/log Version ^3.0
symfony/config Version ^6.4 || ^7.0
symfony/dependency-injection Version ^6.4 || ^7.0
symfony/filesystem Version ^6.4 || ^7.0
symfony/http-client-contracts Version ^3.5
symfony/http-foundation Version ^6.4 || ^7.0
symfony/http-kernel Version ^6.4 || ^7.0
symfony/mime Version ^6.4 || ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sensiolabs/gotenberg-bundle contains the following files

Loading the files please wait ....