Skip to content
getnextpdf.com

Enum reference

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.

PHP enums come in two shapes, and the shape changes how you write the value:

  • A backed enum (enum X: string or enum X: int) has a scalar value for every case, so it round-trips through X::from('...') / $case->value. Most enums here are backed.
  • A pure enum (enum X with no backing type) has cases but no scalar value; you always refer to it by case (X::SomeCase). Only UnderlineStyle is 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.

Portrait or landscape page geometry. Passed when you add a page; the engine swaps width and height to match.

PropertyValue
FQCNNextPDF\Contracts\Orientation
Backingstring
Set viaDocument::addPage(?PageSize $size = null, Orientation $orientation = Orientation::Portrait)
CaseBacking value
Portrait'P'
Landscape'L'
use NextPDF\Contracts\Orientation;
use NextPDF\ValueObjects\PageSize;
$pdf->addPage(PageSize::a4(), Orientation::Landscape);

How a stroked open path terminates. ISO 32000-2:2020 §8.4.3.3.

PropertyValue
FQCNNextPDF\Graphics\LineCap
Backingint
Set viathe LineStyle config object (new LineStyle(cap: ...)), applied with Document::setLineStyle(LineStyle $style)
CaseBacking valueMeaning
Butt0Square end at the endpoint, no projection.
Round1Semicircular arc at the endpoint.
Square2Square projection extending half the line width beyond the endpoint.

How two stroked segments meet at a corner. ISO 32000-2:2020 §8.4.3.4.

PropertyValue
FQCNNextPDF\Graphics\LineJoin
Backingint
Set viathe LineStyle config object (new LineStyle(join: ...)), applied with Document::setLineStyle(LineStyle $style)
CaseBacking valueMeaning
Miter0Sharp corner extended to the miter limit.
Round1Circular arc joining the outer edges.
Bevel2Diagonal 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);

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.

PropertyValue
FQCNNextPDF\Graphics\BlendMode
Backingstring
Set viaDocument::setAlpha(float $alpha, BlendMode $mode = BlendMode::Normal)
CaseBacking valueCaseBacking 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');

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.

PropertyValue
FQCNNextPDF\Graphics\RenderingIntent
Backingstring
Set viaEngine-level only — applied on the internal drawing engine; no public Document/Config setter.
CaseBacking valueMeaning
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.

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.

PropertyValue
FQCNNextPDF\Core\OutputColorProfile
Backingstring
Set viaConfig::withOutputColorProfile(OutputColorProfile $profile) (the Config constructor’s $outputColorProfile parameter)
CaseBacking valueNotes
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);

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.

PropertyValue
FQCNNextPDF\Content\TextRenderingMode
Backingint
Set viaDocument::setTextRenderingMode(TextRenderingMode $mode)
CaseBacking valueMeaning
Fill0Fill glyphs.
Stroke1Stroke glyph outlines.
FillStroke2Fill then stroke.
Invisible3Render invisibly (searchable OCR layers).
FillClip4Fill and add to clipping path.
StrokeClip5Stroke and add to clipping path.
FillStrokeClip6Fill, stroke, and clip.
Clip7Add to clipping path only (no visible rendering).

How an underline decoration is drawn. This is the only pure enum here, so you always refer to it by case.

PropertyValue
FQCNNextPDF\Contracts\UnderlineStyle
Backingpure (no backing value)
Set viaDocument::setUnderlineStyle(UnderlineStyle $style)
CaseMeaning
RectFillFilled rectangle below the baseline (TCPDF-compatible default).
StrokeLineStroked 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);

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.

PropertyValue
FQCNNextPDF\Conformance\ConformanceMode
Backingstring
Set viaDocument::setConformanceMode(ConformanceMode $mode) (lower-level escape hatch; prefer enableTaggedPdf() for PDF/UA-2 in Core, or enablePdfA() — Premium-only — for PDF/A)
CaseBacking valueContract
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, and PdfUa2. The Tagged PDF / PDF/UA path is built into Core — enableTaggedPdf() selects the PDF/UA authoring path (PdfUa2 by 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 by enablePdfA(), which is a Premium-tier feature (ADR-011): it requires the nextpdf/pro package and fails closed with an InvalidConfigException (“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);

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).

PropertyValue
FQCNNextPDF\Navigation\AFRelationship
Backingstring
Set viaDocument::embedFile(string $path, string $description = '', AFRelationship|string $afRelationship = AFRelationship::Unspecified)
CaseBacking valueUse
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);