Enum reference
At a glance
Section titled “At a glance”Several NextPDF authoring methods take a typed enum rather than a bare string or
integer. The enum is the contract: it constrains the argument to a fixed, valid
set, and the IDE and PHPStan reject any value outside it. This page is the
allowed-value lookup for the enums you set (or receive) through the public
Document and Config API — plus one engine-level color enum
(RenderingIntent), included because its cases are part of the public color
contract and flagged as engine-level where it appears.
This is the companion to the configuration reference. Where
the Config object tells you which knob to turn,
this page tells you which values that knob accepts. Each entry lists the
enum’s fully-qualified class name (FQCN), its backing type, the exact case list
copied from source, and the public method that takes it.
Deep engine-internal enums (HTML/CSS layout, the abstract syntax tree, the CLI,
the shaper internals) are deliberately excluded — you never set those. Almost
everything below is a value you pass in through the public API; the one
exception, RenderingIntent, is an engine-level color enum with no public
setter, listed for completeness and labeled as such where it appears.
Backing types
Section titled “Backing types”PHP enums come in two shapes, and the shape changes how you write the value:
- A backed enum (
enum X: stringorenum X: int) has a scalarvaluefor every case, so it round-trips throughX::from('...')/$case->value. Most enums here are backed. - A pure enum (
enum Xwith no backing type) has cases but no scalar value; you always refer to it by case (X::SomeCase). OnlyUnderlineStyleis pure.
In both shapes you pass the case itself — for example
$pdf->addPage(orientation: Orientation::Landscape). The backing type matters
only when you need to serialize the choice or read it back from configuration.
Page setup
Section titled “Page setup”Orientation
Section titled “Orientation”Portrait or landscape page geometry. Passed when you add a page; the engine swaps width and height to match.
| Property | Value |
|---|---|
| FQCN | NextPDF\Contracts\Orientation |
| Backing | string |
| Set via | Document::addPage(?PageSize $size = null, Orientation $orientation = Orientation::Portrait) |
| Case | Backing value |
|---|---|
Portrait | 'P' |
Landscape | 'L' |
use NextPDF\Contracts\Orientation;use NextPDF\ValueObjects\PageSize;
$pdf->addPage(PageSize::a4(), Orientation::Landscape);Drawing and graphics
Section titled “Drawing and graphics”LineCap
Section titled “LineCap”How a stroked open path terminates. ISO 32000-2:2020 §8.4.3.3.
| Property | Value |
|---|---|
| FQCN | NextPDF\Graphics\LineCap |
| Backing | int |
| Set via | the LineStyle config object (new LineStyle(cap: ...)), applied with Document::setLineStyle(LineStyle $style) |
| Case | Backing value | Meaning |
|---|---|---|
Butt | 0 | Square end at the endpoint, no projection. |
Round | 1 | Semicircular arc at the endpoint. |
Square | 2 | Square projection extending half the line width beyond the endpoint. |
LineJoin
Section titled “LineJoin”How two stroked segments meet at a corner. ISO 32000-2:2020 §8.4.3.4.
| Property | Value |
|---|---|
| FQCN | NextPDF\Graphics\LineJoin |
| Backing | int |
| Set via | the LineStyle config object (new LineStyle(join: ...)), applied with Document::setLineStyle(LineStyle $style) |
| Case | Backing value | Meaning |
|---|---|---|
Miter | 0 | Sharp corner extended to the miter limit. |
Round | 1 | Circular arc joining the outer edges. |
Bevel | 2 | Diagonal connecting the outer edges. |
LineCap and LineJoin are not passed to a Document method directly — they are
fields of the immutable NextPDF\Graphics\LineStyle value object, which you then
hand to setLineStyle():
use NextPDF\Graphics\{LineStyle, LineCap, LineJoin};
$style = new LineStyle(width: 1.5, cap: LineCap::Round, join: LineJoin::Bevel);$pdf->setLineStyle($style);$pdf->line(20, 20, 120, 20);BlendMode
Section titled “BlendMode”The transparency blend function applied to subsequent drawing. The first twelve cases are separable; the final four are the non-separable HSL modes. ISO 32000-2:2020 §11.3.5.
| Property | Value |
|---|---|
| FQCN | NextPDF\Graphics\BlendMode |
| Backing | string |
| Set via | Document::setAlpha(float $alpha, BlendMode $mode = BlendMode::Normal) |
| Case | Backing value | Case | Backing value |
|---|---|---|---|
Normal | 'Normal' | HardLight | 'HardLight' |
Multiply | 'Multiply' | SoftLight | 'SoftLight' |
Screen | 'Screen' | Difference | 'Difference' |
Overlay | 'Overlay' | Exclusion | 'Exclusion' |
Darken | 'Darken' | Hue | 'Hue' |
Lighten | 'Lighten' | Saturation | 'Saturation' |
ColorDodge | 'ColorDodge' | Color | 'Color' |
ColorBurn | 'ColorBurn' | Luminosity | 'Luminosity' |
use NextPDF\Graphics\BlendMode;
$pdf->setAlpha(0.6, BlendMode::Multiply);$pdf->rect(20, 20, 80, 40, 'F');RenderingIntent
Section titled “RenderingIntent”How out-of-gamut colors are remapped during color conversion. Emitted as the
ri operator. ISO 32000-2:2020 §8.6.5.8 (Table 71).
Unlike the other enums on this page, RenderingIntent has no public Document
or Config setter — it is an engine-level enum. It is applied directly on
the internal drawing engine (DrawingEngine::setRenderingIntent()), which emits
the ri operator into the current content stream. We list it here for
completeness because its cases are part of the public color contract, but it is
not part of the developer-facing authoring API the rest of this page documents;
treat the drawing engine as an internal class rather than the entrypoint you
program against.
| Property | Value |
|---|---|
| FQCN | NextPDF\Graphics\RenderingIntent |
| Backing | string |
| Set via | Engine-level only — applied on the internal drawing engine; no public Document/Config setter. |
| Case | Backing value | Meaning |
|---|---|---|
RelativeColorimetric | 'RelativeColorimetric' | Preserve in-gamut colors; clip out-of-gamut. |
AbsoluteColorimetric | 'AbsoluteColorimetric' | Preserve colorimetric values exactly, including paper white. |
Saturation | 'Saturation' | Preserve vivid saturation at the expense of hue/luminance. |
Perceptual | 'Perceptual' | Preserve visual relationships; smooth gamut compression. |
OutputColorProfile
Section titled “OutputColorProfile”The working-space color profile declared on the document’s /OutputIntent. The
default DeviceRGB preserves the legacy “no extra OutputIntent” behavior;
selecting any other case makes the writer emit a /GTS_PDFX OutputIntent with
the bundled ICC profile (ISO 32000-2:2020 §14.11.5). This is a Config
value, not a per-call method — set it on the configuration object you pass to the
Document.
| Property | Value |
|---|---|
| FQCN | NextPDF\Core\OutputColorProfile |
| Backing | string |
| Set via | Config::withOutputColorProfile(OutputColorProfile $profile) (the Config constructor’s $outputColorProfile parameter) |
| Case | Backing value | Notes |
|---|---|---|
DeviceRGB | 'device-rgb' | Default. No additional OutputIntent emitted. |
Srgb | 'srgb' | Explicit sRGB OutputIntent (IEC 61966-2-1). Not wide gamut. |
DisplayP3 | 'display-p3' | Display-P3 wide gamut (D65). |
Rec2020 | 'rec2020' | ITU-R BT.2020 / Rec.2020 wide gamut. |
A98RGB | 'a98-rgb' | Adobe RGB 1998. |
ProphotoRGB | 'prophoto-rgb' | ProPhoto RGB / ROMM RGB (D50). |
use NextPDF\Core\{Config, OutputColorProfile};
$config = (new Config())->withOutputColorProfile(OutputColorProfile::DisplayP3);TextRenderingMode
Section titled “TextRenderingMode”Whether glyphs are filled, stroked, clipped, or rendered invisibly (the invisible mode underlies searchable OCR layers). ISO 32000-2:2020 §9.3.6, Table 104.
| Property | Value |
|---|---|
| FQCN | NextPDF\Content\TextRenderingMode |
| Backing | int |
| Set via | Document::setTextRenderingMode(TextRenderingMode $mode) |
| Case | Backing value | Meaning |
|---|---|---|
Fill | 0 | Fill glyphs. |
Stroke | 1 | Stroke glyph outlines. |
FillStroke | 2 | Fill then stroke. |
Invisible | 3 | Render invisibly (searchable OCR layers). |
FillClip | 4 | Fill and add to clipping path. |
StrokeClip | 5 | Stroke and add to clipping path. |
FillStrokeClip | 6 | Fill, stroke, and clip. |
Clip | 7 | Add to clipping path only (no visible rendering). |
UnderlineStyle
Section titled “UnderlineStyle”How an underline decoration is drawn. This is the only pure enum here, so you always refer to it by case.
| Property | Value |
|---|---|
| FQCN | NextPDF\Contracts\UnderlineStyle |
| Backing | pure (no backing value) |
| Set via | Document::setUnderlineStyle(UnderlineStyle $style) |
| Case | Meaning |
|---|---|
RectFill | Filled rectangle below the baseline (TCPDF-compatible default). |
StrokeLine | Stroked line below the baseline (semantic line drawing). |
use NextPDF\Content\TextRenderingMode;use NextPDF\Contracts\UnderlineStyle;
$pdf->setTextRenderingMode(TextRenderingMode::Invisible); // OCR text layer$pdf->setUnderlineStyle(UnderlineStyle::StrokeLine);Conformance
Section titled “Conformance”ConformanceMode
Section titled “ConformanceMode”The document-level conformance contract: which ISO part the writer must honor,
and whether structural tagging is required. The default Plain is unconstrained
PDF 2.0 output. ISO 14289-2:2024 (PDF/UA-2) and the ISO 19005 PDF/A parts.
| Property | Value |
|---|---|
| FQCN | NextPDF\Conformance\ConformanceMode |
| Backing | string |
| Set via | Document::setConformanceMode(ConformanceMode $mode) (lower-level escape hatch; prefer enableTaggedPdf() for PDF/UA-2 in Core, or enablePdfA() — Premium-only — for PDF/A) |
| Case | Backing value | Contract |
|---|---|---|
Plain | 'plain' | PDF 2.0, unconstrained (default). |
PdfUa1 | 'pdfua1' | ISO 14289-1 (Tagged PDF/UA-1). |
PdfUa2 | 'pdfua2' | ISO 14289-2:2024 (Tagged PDF/UA-2). |
PdfA2 | 'pdfa2' | ISO 19005-2 (PDF/A-2). |
PdfA3 | 'pdfa3' | ISO 19005-3 (PDF/A-3 profile discriminator). |
PdfA3b | 'pdfa3b' | ISO 19005-3 PDF/A-3b (Basic). |
PdfA3u | 'pdfa3u' | ISO 19005-3 PDF/A-3u (Unicode-extractable). |
PdfA4 | 'pdfa4' | ISO 19005-4:2020 (PDF/A-4 profile discriminator). |
PdfA4e | 'pdfa4e' | ISO 19005-4:2020 PDF/A-4e (Engineering). |
PdfA4f | 'pdfa4f' | ISO 19005-4:2020 PDF/A-4f (File attachments). |
The enum carries predicate helpers — isTagged(), isAccessibility(),
isArchival(), and pdfaPart() — so writer-side gates branch on the mode
rather than re-deriving it.
Which cases a Core-only build can actually use. The enum type lists every
case, but listing a case is not the same as being able to produce that
conformance from Core:
- Core (no extra package):
Plain,PdfUa1, andPdfUa2. The Tagged PDF / PDF/UA path is built into Core —enableTaggedPdf()selects the PDF/UA authoring path (PdfUa2by default) and wires the structure tree without any license check. - Premium-only: every PDF/A case (
PdfA2,PdfA3,PdfA3b,PdfA3u,PdfA4,PdfA4e,PdfA4f). Real PDF/A output is produced byenablePdfA(), which is a Premium-tier feature (ADR-011): it requires thenextpdf/propackage and fails closed with anInvalidConfigException(“install the nextpdf/pro package”) when that package is absent.
setConformanceMode() is a lower-level escape hatch that only writes the
discriminator field — it does not install the PDF/A machinery. Setting a
PdfA* case through it in a Core-only build therefore labels the document
without giving it the archival guarantees enablePdfA() provides, so the
Premium-only modes must not be relied on in a Core-only build. Use
enableTaggedPdf() / enablePdfA() for the real conformance paths, and reach
for the Premium package whenever a PDF/A deliverable is required.
use NextPDF\Conformance\ConformanceMode;
$pdf->setConformanceMode(ConformanceMode::PdfUa2);Attachments
Section titled “Attachments”AFRelationship
Section titled “AFRelationship”The /AFRelationship value for an embedded associated file. A non-conforming
value fails PDF/A-3 and PDF/A-4 validation, so the enum is the safe way to set
it. ISO 32000-2:2020 §14.13.5 (Table 401).
| Property | Value |
|---|---|
| FQCN | NextPDF\Navigation\AFRelationship |
| Backing | string |
| Set via | Document::embedFile(string $path, string $description = '', AFRelationship|string $afRelationship = AFRelationship::Unspecified) |
| Case | Backing value | Use |
|---|---|---|
Source | 'Source' | The source document the PDF was produced from. |
Data | 'Data' | Raw data the PDF is derived from (e.g. Factur-X / ZUGFeRD XML). |
Alternative | 'Alternative' | Alternative presentation (braille, captions, SVG). |
Supplement | 'Supplement' | Supplementary material. |
EncryptedPayload | 'EncryptedPayload' | An opaque encrypted blob the PDF wraps. |
FormData | 'FormData' | Form data (XFDF, FDF, XML). |
Schema | 'Schema' | Schema describing a Data file (XSD, JSON Schema). PDF 2.0. |
Unspecified | 'Unspecified' | No relationship specified (default). |
embedFile() accepts either the enum case or its string literal (with or
without a leading slash), so AFRelationship::Data and '/Data' are
equivalent. Passing the case is the type-safe choice.
use NextPDF\Navigation\AFRelationship;
// e-invoice payload: declare the XML as the source data$pdf->embedFile('invoice.xml', 'Factur-X invoice data', AFRelationship::Data);See also
Section titled “See also”- Configuration reference — the
Configobject whose values these enums constrain, includingwithOutputColorProfile(). - Graphics module —
LineStyle,BlendMode,RenderingIntent, and the drawing engine. - Typography module — text rendering and underline decoration.
- Conformance module — the
ConformanceModediscriminator and the PDF/UA / PDF/A enable paths. - Navigation module — associated files and the
/AFmechanism. - Reference index — the entry point for API, configuration, and compatibility reference material.