Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m-adamski/symfony-pdf-bundle
Bundle for Symfony for conveniently generating PDF documents
https://github.com/m-adamski/symfony-pdf-bundle
pdf-bundle php symfony symfony-bundle
Last synced: 26 days ago
JSON representation
Bundle for Symfony for conveniently generating PDF documents
- Host: GitHub
- URL: https://github.com/m-adamski/symfony-pdf-bundle
- Owner: m-adamski
- License: mit
- Created: 2018-10-25T08:02:42.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-06T12:19:08.000Z (9 months ago)
- Last Synced: 2024-09-10T19:19:38.380Z (about 2 months ago)
- Topics: pdf-bundle, php, symfony, symfony-bundle
- Language: PHP
- Homepage:
- Size: 2.61 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PDF Bundle for Symfony
Helper whose goal is to simplify the process of generating PDF documents using the [TCPDF library](https://tcpdf.org).
This bundle is compatible with Symfony 4.1 and Symfony 5.0. Symfony 3.4 compatibility abandoned.
## Installation
This bundle can be installed by Composer:
```
$ composer require m-adamski/symfony-pdf-bundle
```## How to use it?
There is only one function that generates an instance of the PDFDocument class with the default settings. You can modify parameters before generating the final PDF document.
| Method | Description |
| ------------ | -------------------------------------------------------------- |
| initDocument | A function that generates an instance of the PDFDocument class |## PDF Document
An instance of the PDFDocument class that will be generated using the helper contains an additional set of functions.
| Method | Description |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| writeHTML | The function sets the content of the document from the given HTML code |
| renderHTML | Similar to the writeHTML function, the content of the document is set from the HTML code that will be generated from the given Twig template |
| setFooter | A function to configure the footer of a PDF document |
| setFont | With this function, you can change the font that will be used when generating a PDF document |
| save | The function generates a PDF document |
| output | The function generates a PDF document and returns a response with the Content-Type header set to application/pdf |
| getPDFData | The function returns the PDF document data |There are also getters and setters for the basic parameters of a PDF document (author, tags, etc.).
## License
MIT