Laravel Configuration
All options live in config/tcpdf-next.php. Publish it with:
bash
php artisan vendor:publish --tag=tcpdf-next-configPage Defaults
php
'page' => [
'format' => env('TCPDF_PAGE_FORMAT', 'A4'),
'orientation' => 'portrait', // 'portrait' | 'landscape'
'unit' => 'mm', // 'mm' | 'pt' | 'cm' | 'in'
'margin' => ['top' => 20.0, 'right' => 15.0, 'bottom' => 20.0, 'left' => 15.0],
],| Key | Env Variable | Default | Description |
|---|---|---|---|
page.format | TCPDF_PAGE_FORMAT | A4 | ISO page size (A4, Letter, Legal, etc.) |
page.orientation | -- | portrait | Default page orientation |
page.unit | -- | mm | Unit for all coordinate values |
Font Configuration
php
'fonts' => [
'directory' => resource_path('fonts'),
'cache' => storage_path('framework/cache/tcpdf-next/fonts'),
'default_family' => 'Helvetica',
'default_size' => 11.0,
'subset' => true,
],| Key | Default | Description |
|---|---|---|
fonts.directory | resource_path('fonts') | Path to custom TTF/OTF font files |
fonts.cache | storage_path('.../fonts') | Compiled font metrics cache |
fonts.default_family | Helvetica | Font family when none is specified |
fonts.default_size | 11.0 | Default font size in points |
fonts.subset | true | Embed only used glyphs to reduce file size |
PDF/A Compliance
php
'pdfa' => [
'enabled' => env('TCPDF_PDFA', false),
'version' => 'PDF/A-4',
'output_intent' => 'sRGB',
],| Key | Env Variable | Default | Description |
|---|---|---|---|
pdfa.enabled | TCPDF_PDFA | false | Enable PDF/A conformance |
pdfa.version | -- | PDF/A-4 | Target PDF/A version |
pdfa.output_intent | -- | sRGB | ICC output intent profile |
Encryption Settings
php
'encryption' => [
'level' => 'aes-256',
'user_pass' => env('TCPDF_USER_PASS', ''),
'owner_pass' => env('TCPDF_OWNER_PASS', ''),
'permissions' => ['print', 'copy'],
],| Key | Default | Description |
|---|---|---|
encryption.level | aes-256 | Algorithm: aes-256, aes-128, rc4-128 |
encryption.user_pass | '' | Password to open the document |
encryption.owner_pass | '' | Password to change permissions |
encryption.permissions | ['print', 'copy'] | Allowed: print, copy, modify, annotate |
Digital Signature Settings
php
'signature' => [
'enabled' => env('TCPDF_SIGN_ENABLED', false),
'cert_path' => env('TCPDF_SIGN_CERT', ''),
'key_path' => env('TCPDF_SIGN_KEY', ''),
'key_pass' => env('TCPDF_SIGN_KEY_PASS', ''),
'level' => env('TCPDF_SIGN_LEVEL', 'B-B'),
'tsa_url' => env('TCPDF_TSA_URL', ''),
],| Key | Env Variable | Default | Description |
|---|---|---|---|
signature.enabled | TCPDF_SIGN_ENABLED | false | Enable automatic signing |
signature.cert_path | TCPDF_SIGN_CERT | '' | Path to PEM certificate |
signature.key_path | TCPDF_SIGN_KEY | '' | Path to PEM private key |
signature.level | TCPDF_SIGN_LEVEL | B-B | PAdES level (B-B, B-T, B-LT, B-LTA) |
signature.tsa_url | TCPDF_TSA_URL | '' | RFC 3161 timestamp authority URL |
Queue Configuration
php
'queue' => [
'connection' => env('TCPDF_QUEUE_CONNECTION', null),
'queue' => env('TCPDF_QUEUE', 'pdf'),
'disk' => env('TCPDF_DISK', 'local'),
'tries' => 3,
'backoff' => 30,
'timeout' => 120,
],| Key | Env Variable | Default | Description |
|---|---|---|---|
queue.connection | TCPDF_QUEUE_CONNECTION | null | Queue connection (null = default) |
queue.queue | TCPDF_QUEUE | pdf | Queue name for PDF jobs |
queue.disk | TCPDF_DISK | local | Default filesystem disk for output |
queue.tries | -- | 3 | Max retry attempts |
queue.backoff | -- | 30 | Seconds between retries |
queue.timeout | -- | 120 | Job timeout in seconds |
Next Steps
- Overview — Package architecture and service provider bindings
- Pdf Facade — How config values are applied to new documents
- Queue Jobs — Queue-specific configuration in action