Enums Reference
TCPDF-Next uses PHP 8.1+ backed enums throughout the library to replace loosely typed string and integer constants. This page documents every enum, its cases, and typical usage.
Orientation
Namespace: TcpdfNext\Contracts\Orientation
Page orientation.
| Case | Description |
|---|---|
Portrait | Taller than wide (default) |
Landscape | Wider than tall |
use TcpdfNext\Contracts\Orientation;
$pdf->addPage(orientation: Orientation::Landscape);Alignment
Namespace: TcpdfNext\Contracts\Alignment
Horizontal text and content alignment.
| Case | Description |
|---|---|
Left | Align to the left margin |
Center | Center between margins |
Right | Align to the right margin |
Justified | Stretch text to fill the full width |
use TcpdfNext\Contracts\Alignment;
$pdf->multiCell(width: 0, height: 10, text: $paragraph, align: Alignment::Justified);OutputDestination
Namespace: TcpdfNext\Contracts\OutputDestination
Where to send the rendered PDF.
| Case | Description |
|---|---|
Inline | Send to the browser with Content-Disposition: inline |
Download | Send to the browser with Content-Disposition: attachment |
File | Write to a file on disk |
String | Return the raw binary as a string |
use TcpdfNext\Contracts\OutputDestination;
$binary = $pdf->output(OutputDestination::String);
$pdf->output(OutputDestination::File, path: '/reports/q4.pdf');SignatureLevel
Namespace: TcpdfNext\Contracts\SignatureLevel
PAdES digital signature conformance level per ETSI EN 319 142.
| Case | Description |
|---|---|
PAdES_B_B | Basic signature with signing certificate |
PAdES_B_T | Adds a trusted RFC 3161 timestamp |
PAdES_B_LT | Adds validation data (DSS, OCSP, CRL) for long-term verification |
PAdES_B_LTA | Adds an archive timestamp for indefinite verification |
use TcpdfNext\Contracts\SignatureLevel;
$pdf->security()->sign(
certFile: '/certs/signer.p12',
password: 'secret',
level: SignatureLevel::PAdES_B_LTA,
);BlendMode
Namespace: TcpdfNext\Graphics\BlendMode
PDF transparency blend modes per ISO 32000-2 Section 11.3.5.
| Case | Description |
|---|---|
Normal | Default compositing |
Multiply | Darkens by multiplying colors |
Screen | Lightens by inverting, multiplying, and inverting again |
Overlay | Combines Multiply and Screen based on base color |
Darken | Selects the darker of base and blend colors |
Lighten | Selects the lighter of base and blend colors |
ColorDodge | Brightens the base color to reflect the blend color |
ColorBurn | Darkens the base color to reflect the blend color |
HardLight | Combines Multiply and Screen based on blend color |
SoftLight | Subtle darkening or lightening |
Difference | Subtracts the darker from the lighter color |
Exclusion | Similar to Difference with lower contrast |
use TcpdfNext\Graphics\BlendMode;
$pdf->setAlpha(0.5, blendMode: BlendMode::Multiply);BarcodeType
Namespace: TcpdfNext\Barcode\BarcodeType
Supported 1D barcode symbologies.
| Case | Description |
|---|---|
CODE_39 | Code 39 (alphanumeric) |
CODE_39E | Code 39 Extended (full ASCII) |
CODE_93 | Code 93 |
CODE_128 | Code 128 (auto mode switching) |
CODE_128A | Code 128 subset A |
CODE_128B | Code 128 subset B |
CODE_128C | Code 128 subset C (numeric pairs) |
EAN_8 | EAN-8 |
EAN_13 | EAN-13 |
UPC_A | UPC-A |
UPC_E | UPC-E |
ITF_14 | ITF-14 (Interleaved 2 of 5) |
CODABAR | Codabar |
PHARMACODE | Pharmacode |
MSI | MSI Plessey |
POSTNET | POSTNET (US postal) |
Barcode2DType
Namespace: TcpdfNext\Barcode\Barcode2DType
Supported 2D barcode symbologies.
| Case | Description |
|---|---|
QR_CODE | QR Code (ISO 18004) with configurable error correction (L/M/Q/H) |
DATAMATRIX | Data Matrix ECC 200 (ISO 16022) |
PDF417 | PDF417 (ISO 15438) |
use TcpdfNext\Barcode\Barcode2DType;
$pdf->barcode2D('https://example.com', Barcode2DType::QR_CODE, w: 30, h: 30);FormFieldType
Namespace: TcpdfNext\Form\FormFieldType
AcroForm field types.
| Case | Description |
|---|---|
TEXT | Single-line text input |
PASSWORD | Password text input (masked) |
TEXTAREA | Multi-line text input |
CHECKBOX | Checkbox toggle |
RADIO | Radio button (part of a group) |
LISTBOX | Scrollable list selection |
COMBOBOX | Dropdown selection |
BUTTON | Push button with optional JavaScript action |
PdfAVersion
Namespace: TcpdfNext\Archive\PdfAVersion
PDF/A conformance versions supported by TCPDF-Next.
| Case | Description |
|---|---|
A4 | PDF/A-4 (ISO 19005-4:2020) -- base conformance |
A4f | PDF/A-4f -- allows embedded files |
A4e | PDF/A-4e -- allows 3D and rich media content |
use TcpdfNext\Archive\PdfAVersion;
$pdf->archive()->enablePdfA(PdfAVersion::A4f);FontType
Namespace: TcpdfNext\Typography\FontType
Supported font format types.
| Case | Description |
|---|---|
TrueType | TrueType fonts (.ttf) |
OpenType | OpenType fonts (.otf, CFF or glyf outlines) |
Type1 | PostScript Type 1 fonts (.pfb/.pfm) |
Core | One of the 14 PDF standard (Base 14) fonts -- no embedding required |
ColorSpace
Namespace: TcpdfNext\Graphics\ColorSpace
PDF color space identifiers.
| Case | Description |
|---|---|
DeviceRGB | Red / Green / Blue (screen) |
DeviceCMYK | Cyan / Magenta / Yellow / Key (print) |
DeviceGray | Single-channel grayscale |
Separation | Named spot color channel |
use TcpdfNext\Graphics\ColorSpace;
$color = Color::fromSpace(ColorSpace::DeviceCMYK, [100, 0, 0, 0]);ObjectEntryType
Namespace: TcpdfNext\Core\ObjectEntryType
Classifies the kind of PDF indirect object in the ObjectRegistry.
| Case |
|---|
Catalog |
Pages |
Page |
Font |
FontDescriptor |
Image |
XObject |
ExtGState |
ColorSpace |
Pattern |
Shading |
Annotation |
Bookmark |
AcroField |
Signature |
Metadata |
OutputIntent |
StructElement |
Stream |
Generic |
AnnotationType
Namespace: TcpdfNext\Navigation\AnnotationType
Markup annotation types per ISO 32000-2 Section 12.5.6.
| Case | Description |
|---|---|
Text | Sticky note icon |
Highlight | Highlight text markup |
Underline | Underline text markup |
StrikeOut | Strikethrough text markup |
Squiggly | Squiggly underline text markup |
FreeText | Inline text callout |
LineCapStyle
Namespace: TcpdfNext\Graphics\LineCapStyle
Line cap styles per ISO 32000-2 Section 8.4.3.3.
| Case | Value | Description |
|---|---|---|
Butt | 0 | Square cap flush with the endpoint |
Round | 1 | Semicircular cap extending beyond the endpoint |
Square | 2 | Square cap extending beyond the endpoint |
LineJoinStyle
Namespace: TcpdfNext\Graphics\LineJoinStyle
Line join styles per ISO 32000-2 Section 8.4.3.4.
| Case | Value | Description |
|---|---|---|
Miter | 0 | Sharp corner |
Round | 1 | Rounded corner |
Bevel | 2 | Diagonal flat corner |
TextDirection
Namespace: TcpdfNext\Typography\TextDirection
Text direction for bidirectional (BiDi) rendering.
| Case | Description |
|---|---|
LeftToRight | Default (LTR) |
RightToLeft | Right-to-left (Arabic, Hebrew) |
Auto | Detect from the first strong character |
HashAlgorithm
Namespace: TcpdfNext\Security\HashAlgorithm
Digest algorithms used in signatures and encryption.
| Case | Description |
|---|---|
SHA256 | SHA-256 (default, recommended) |
SHA384 | SHA-384 |
SHA512 | SHA-512 |
PermissionFlag
Namespace: TcpdfNext\Security\PermissionFlag
Document permission flags for setProtection().
| Case | Description |
|---|---|
Print | Allow printing |
PrintHighRes | Allow high-resolution printing |
Modify | Allow document modification |
Copy | Allow text and image extraction |
AnnotForms | Allow annotations and form filling |
FillForms | Allow form filling only |
Extract | Allow accessibility text extraction |
Assemble | Allow page insertion, rotation, deletion |
ErrorCorrectionLevel
Namespace: TcpdfNext\Barcode\ErrorCorrectionLevel
QR Code error correction levels per ISO 18004.
| Case | Recovery Capacity |
|---|---|
Low | ~7% |
Medium | ~15% |
Quartile | ~25% |
High | ~30% |
See Also
- API Overview -- All packages at a glance
- Document API -- Methods that accept these enums as parameters
- Interfaces Reference -- Contracts that reference these enums