Skip to content

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.

CaseDescription
PortraitTaller than wide (default)
LandscapeWider than tall
php
use TcpdfNext\Contracts\Orientation;

$pdf->addPage(orientation: Orientation::Landscape);

Alignment

Namespace: TcpdfNext\Contracts\Alignment

Horizontal text and content alignment.

CaseDescription
LeftAlign to the left margin
CenterCenter between margins
RightAlign to the right margin
JustifiedStretch text to fill the full width
php
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.

CaseDescription
InlineSend to the browser with Content-Disposition: inline
DownloadSend to the browser with Content-Disposition: attachment
FileWrite to a file on disk
StringReturn the raw binary as a string
php
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.

CaseDescription
PAdES_B_BBasic signature with signing certificate
PAdES_B_TAdds a trusted RFC 3161 timestamp
PAdES_B_LTAdds validation data (DSS, OCSP, CRL) for long-term verification
PAdES_B_LTAAdds an archive timestamp for indefinite verification
php
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.

CaseDescription
NormalDefault compositing
MultiplyDarkens by multiplying colors
ScreenLightens by inverting, multiplying, and inverting again
OverlayCombines Multiply and Screen based on base color
DarkenSelects the darker of base and blend colors
LightenSelects the lighter of base and blend colors
ColorDodgeBrightens the base color to reflect the blend color
ColorBurnDarkens the base color to reflect the blend color
HardLightCombines Multiply and Screen based on blend color
SoftLightSubtle darkening or lightening
DifferenceSubtracts the darker from the lighter color
ExclusionSimilar to Difference with lower contrast
php
use TcpdfNext\Graphics\BlendMode;

$pdf->setAlpha(0.5, blendMode: BlendMode::Multiply);

BarcodeType

Namespace: TcpdfNext\Barcode\BarcodeType

Supported 1D barcode symbologies.

CaseDescription
CODE_39Code 39 (alphanumeric)
CODE_39ECode 39 Extended (full ASCII)
CODE_93Code 93
CODE_128Code 128 (auto mode switching)
CODE_128ACode 128 subset A
CODE_128BCode 128 subset B
CODE_128CCode 128 subset C (numeric pairs)
EAN_8EAN-8
EAN_13EAN-13
UPC_AUPC-A
UPC_EUPC-E
ITF_14ITF-14 (Interleaved 2 of 5)
CODABARCodabar
PHARMACODEPharmacode
MSIMSI Plessey
POSTNETPOSTNET (US postal)

Barcode2DType

Namespace: TcpdfNext\Barcode\Barcode2DType

Supported 2D barcode symbologies.

CaseDescription
QR_CODEQR Code (ISO 18004) with configurable error correction (L/M/Q/H)
DATAMATRIXData Matrix ECC 200 (ISO 16022)
PDF417PDF417 (ISO 15438)
php
use TcpdfNext\Barcode\Barcode2DType;

$pdf->barcode2D('https://example.com', Barcode2DType::QR_CODE, w: 30, h: 30);

FormFieldType

Namespace: TcpdfNext\Form\FormFieldType

AcroForm field types.

CaseDescription
TEXTSingle-line text input
PASSWORDPassword text input (masked)
TEXTAREAMulti-line text input
CHECKBOXCheckbox toggle
RADIORadio button (part of a group)
LISTBOXScrollable list selection
COMBOBOXDropdown selection
BUTTONPush button with optional JavaScript action

PdfAVersion

Namespace: TcpdfNext\Archive\PdfAVersion

PDF/A conformance versions supported by TCPDF-Next.

CaseDescription
A4PDF/A-4 (ISO 19005-4:2020) -- base conformance
A4fPDF/A-4f -- allows embedded files
A4ePDF/A-4e -- allows 3D and rich media content
php
use TcpdfNext\Archive\PdfAVersion;

$pdf->archive()->enablePdfA(PdfAVersion::A4f);

FontType

Namespace: TcpdfNext\Typography\FontType

Supported font format types.

CaseDescription
TrueTypeTrueType fonts (.ttf)
OpenTypeOpenType fonts (.otf, CFF or glyf outlines)
Type1PostScript Type 1 fonts (.pfb/.pfm)
CoreOne of the 14 PDF standard (Base 14) fonts -- no embedding required

ColorSpace

Namespace: TcpdfNext\Graphics\ColorSpace

PDF color space identifiers.

CaseDescription
DeviceRGBRed / Green / Blue (screen)
DeviceCMYKCyan / Magenta / Yellow / Key (print)
DeviceGraySingle-channel grayscale
SeparationNamed spot color channel
php
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.

CaseDescription
TextSticky note icon
HighlightHighlight text markup
UnderlineUnderline text markup
StrikeOutStrikethrough text markup
SquigglySquiggly underline text markup
FreeTextInline text callout

LineCapStyle

Namespace: TcpdfNext\Graphics\LineCapStyle

Line cap styles per ISO 32000-2 Section 8.4.3.3.

CaseValueDescription
Butt0Square cap flush with the endpoint
Round1Semicircular cap extending beyond the endpoint
Square2Square cap extending beyond the endpoint

LineJoinStyle

Namespace: TcpdfNext\Graphics\LineJoinStyle

Line join styles per ISO 32000-2 Section 8.4.3.4.

CaseValueDescription
Miter0Sharp corner
Round1Rounded corner
Bevel2Diagonal flat corner

TextDirection

Namespace: TcpdfNext\Typography\TextDirection

Text direction for bidirectional (BiDi) rendering.

CaseDescription
LeftToRightDefault (LTR)
RightToLeftRight-to-left (Arabic, Hebrew)
AutoDetect from the first strong character

HashAlgorithm

Namespace: TcpdfNext\Security\HashAlgorithm

Digest algorithms used in signatures and encryption.

CaseDescription
SHA256SHA-256 (default, recommended)
SHA384SHA-384
SHA512SHA-512

PermissionFlag

Namespace: TcpdfNext\Security\PermissionFlag

Document permission flags for setProtection().

CaseDescription
PrintAllow printing
PrintHighResAllow high-resolution printing
ModifyAllow document modification
CopyAllow text and image extraction
AnnotFormsAllow annotations and form filling
FillFormsAllow form filling only
ExtractAllow accessibility text extraction
AssembleAllow page insertion, rotation, deletion

ErrorCorrectionLevel

Namespace: TcpdfNext\Barcode\ErrorCorrectionLevel

QR Code error correction levels per ISO 18004.

CaseRecovery Capacity
Low~7%
Medium~15%
Quartile~25%
High~30%

See Also

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