Skip to content

Laravel Configuration

All options live in config/tcpdf-next.php. Publish it with:

bash
php artisan vendor:publish --tag=tcpdf-next-config

Page 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],
],
KeyEnv VariableDefaultDescription
page.formatTCPDF_PAGE_FORMATA4ISO page size (A4, Letter, Legal, etc.)
page.orientation--portraitDefault page orientation
page.unit--mmUnit 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,
],
KeyDefaultDescription
fonts.directoryresource_path('fonts')Path to custom TTF/OTF font files
fonts.cachestorage_path('.../fonts')Compiled font metrics cache
fonts.default_familyHelveticaFont family when none is specified
fonts.default_size11.0Default font size in points
fonts.subsettrueEmbed only used glyphs to reduce file size

PDF/A Compliance

php
'pdfa' => [
    'enabled'       => env('TCPDF_PDFA', false),
    'version'       => 'PDF/A-4',
    'output_intent' => 'sRGB',
],
KeyEnv VariableDefaultDescription
pdfa.enabledTCPDF_PDFAfalseEnable PDF/A conformance
pdfa.version--PDF/A-4Target PDF/A version
pdfa.output_intent--sRGBICC 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'],
],
KeyDefaultDescription
encryption.levelaes-256Algorithm: 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', ''),
],
KeyEnv VariableDefaultDescription
signature.enabledTCPDF_SIGN_ENABLEDfalseEnable automatic signing
signature.cert_pathTCPDF_SIGN_CERT''Path to PEM certificate
signature.key_pathTCPDF_SIGN_KEY''Path to PEM private key
signature.levelTCPDF_SIGN_LEVELB-BPAdES level (B-B, B-T, B-LT, B-LTA)
signature.tsa_urlTCPDF_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,
],
KeyEnv VariableDefaultDescription
queue.connectionTCPDF_QUEUE_CONNECTIONnullQueue connection (null = default)
queue.queueTCPDF_QUEUEpdfQueue name for PDF jobs
queue.diskTCPDF_DISKlocalDefault filesystem disk for output
queue.tries--3Max retry attempts
queue.backoff--30Seconds between retries
queue.timeout--120Job 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

Released under the LGPL-3.0-or-later License.