Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Document how to pass configuration values to TCPDF #49

Merged
merged 1 commit into from
Jun 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,40 @@ $pdfObj = $container->get("white_october.tcpdf")->create();

From hereon in, you are using a TCPDF object to work with as normal.

Using a custom class
--------------------
Configuration
--------------

### Configuration values

You can pass parameters to TCPDF like this:

```yaml
# app/config/config.yml (Symfony < 4)
# config/packages/white_october_tcpdf.yaml (Symfony 4)
white_october_tcpdf:
tcpdf:
k_title_magnification: 2
```

You can see the default parameter values in
`WhiteOctober\TCPDFBundle\DependencyInjection\Configuration::addTCPDFConfig`.

If you want, you can use TCPDF's own defaults instead:

```yaml
white_october_tcpdf:
tcpdf:
k_tcpdf_external_config: false # the values set by this bundle will be ignored
```

### Using a custom class

If you want to use your own custom TCPDF-based class, you can use
the `class` parameter in your configuration eg in `config.yml`:
the `class` parameter in your configuration:

``` yaml
```yaml
# app/config/config.yml (Symfony < 4)
# config/packages/white_october_tcpdf.yaml (Symfony 4)
white_october_tcpdf:
class: 'Acme\MyBundle\MyTCPDFClass'
```
Expand Down