Pro edition
Print Job — Deep Reference
At a glance
Section titled “At a glance”XjdfJobTicket builds an XJDF 2.1 (XML JDF 2.0) job ticket for production print workflows. The fluent builder records job metadata, media, color intent, finishing operations, priority, and copy count. toXml then serializes a CIP4-namespaced XML document. The module produces a ticket only. It does not submit the ticket to a press controller or device.
Availability & licensing
Section titled “Availability & licensing”This capability ships in NextPDF Pro (nextpdf/pro) and activates with a Pro-tier license envelope. A deployment without that entitlement does not load the capability’s classes. Compare editions and get a license.
No per-feature license flag applies. This is a Pro-edition capability.
Public API surface
Section titled “Public API surface”composer require nextpdf/pro:^3Entry point — the fluent builder:
final class XjdfJobTicket{ public function __construct(); public function setJobId(string $id): self; public function setJobName(string $name): self; public function setPriority(JobPriority $priority): self; public function setMedia(MediaSpec $media): self; public function setColor(ColorSpec $color): self; public function setFinishing(FinishingSpec $finishing): self; public function setCopies(int $copies): self; public function toXml(): string;}Media specification — immutable value object:
final readonly class MediaSpec{ public function __construct( public string $mediaType = 'Paper', public float $widthMm = 210.0, public float $heightMm = 297.0, public int $weight = 80, public string $coating = 'None', public string $color = 'White', ); public function isStandard(): bool; public function toXjdfElement(): string;}Color intent — immutable value object:
final readonly class ColorSpec{ public function __construct( public bool $useCmyk = true, public bool $useSpotColors = false, public array $spotColorNames = [], public string $renderingIntent = 'RelativeColorimetric', ); public function colorCount(): int;}Finishing intent — immutable value object:
final readonly class FinishingSpec{ public function __construct( public bool $fold = false, public bool $staple = false, public bool $punch = false, public bool $trim = false, public string $binding = 'None', );}Priority — string-backed enum:
enum JobPriority: string{ case Idle = 'Idle'; case Low = 'Low'; case Normal = 'Normal'; case High = 'High'; case Rush = 'Rush';
public function numericValue(): int;}| Symbol | Parameters | Default behavior | Returns | Throws or fails with | Notes |
|---|---|---|---|---|---|
XjdfJobTicket::__construct | none | Priority initialized to JobPriority::Normal; copies to 1. | instance | — | Fluent builder root. |
XjdfJobTicket::setJobId | string $id | Records the job identifier. | self | — | Empty value is permitted; see toXml. |
XjdfJobTicket::setJobName | string $name | Records the human-readable job name. | self | — | Emitted as a GeneralID when non-empty. |
XjdfJobTicket::setPriority | JobPriority $priority | Overrides the default Normal priority. | self | — | — |
XjdfJobTicket::setMedia | MediaSpec $media | Attaches a media resource. | self | — | Optional; omitted when unset. |
XjdfJobTicket::setColor | ColorSpec $color | Attaches a color-intent resource. | self | — | Optional; omitted when unset. |
XjdfJobTicket::setFinishing | FinishingSpec $finishing | Attaches finishing resources. | self | — | Optional; omitted when unset. |
XjdfJobTicket::setCopies | int $copies | Sets the output copy count. | self | InvalidArgumentException when $copies < 1 | Default is 1. |
XjdfJobTicket::toXml | none | Serializes the XJDF 2.1 document. | string | — | Generates a random XJDF_<hex> job ID when none was set. |
MediaSpec::__construct | string $mediaType, float $widthMm, float $heightMm, int $weight, string $coating, string $color | Defaults to A4 white paper at 80 g/m². | instance | — | All parameters optional. |
MediaSpec::isStandard | none | Matches A4, US Letter, or A3 within 0.5 mm. | bool | — | Portrait or landscape. |
MediaSpec::toXjdfElement | none | Emits a <Media> element; converts millimeters to points. | string | — | Omits coating and color at their defaults. |
ColorSpec::__construct | bool $useCmyk, bool $useSpotColors, list<string> $spotColorNames, string $renderingIntent | Defaults to CMYK, relative colorimetric intent. | instance | — | — |
ColorSpec::colorCount | none | Returns 4 for CMYK plus one per spot color. | int | — | — |
FinishingSpec::__construct | bool $fold, bool $staple, bool $punch, bool $trim, string $binding | Defaults to no finishing; binding None. | instance | — | — |
JobPriority | enum cases Idle, Low, Normal, High, Rush | — | enum | — | String-backed. |
JobPriority::numericValue | none | Maps the case to 0, 25, 50, 75, or 100. | int | — | Highest is Rush (100). |
Behavior contract
Section titled “Behavior contract”XjdfJobTicketis a fluent builder. Each setter returnsselffor chaining.toXmlserializes a simplified XJDF 2.1 document under the CIP4 namespacehttp://www.CIP4.org/JDFSchema_2_0, withTypes="ConventionalPrinting".- When no job ID was set,
toXmlsubstitutes a randomXJDF_identifier rather than failing. - Priority is written as both a
Commentand a numericNodeInfoattribute. Copies are written as aComponentoutput amount. - Media, color, and finishing resources appear only when their specifications were set.
- All attribute values are XML-escaped before serialization.
- The module produces the ticket document. It does not render a print stream or submit the ticket to a device.
Edge cases & failure modes
Section titled “Edge cases & failure modes”setCopieswith a value below 1 throwsInvalidArgumentException. This is the only exception the module raises.- An empty or unset job ID is not an error.
toXmlsubstitutes a randomXJDF_<hex>identifier at serialization time. - Media dimensions are millimeters.
toXjdfElementconverts them to PDF points using the factor 72 / 25.4. MediaSpec::isStandardapplies a 0.5 mm tolerance and accepts portrait or landscape orientation.MediaSpec::toXjdfElementomitsFrontCoatingswhen coating isNoneandMediaColorNamewhen color isWhite.- The module performs no cryptographic operations. FIPS mode does not change its behavior.
Conformance
Section titled “Conformance”NextPDF Pro emits a simplified XJDF 2.1 subset.
| Behavior | Reference | Status |
|---|---|---|
| XJDF 2.1 job-ticket structure | XJDF 2.1 (CIP4) | Aligned — simplified subset |
Development notes
Section titled “Development notes”- Root and namespace: an
<XJDF>element underhttp://www.CIP4.org/JDFSchema_2_0, withTypes="ConventionalPrinting". - The color serializer emits
NumColorsandColorsUsed.ColorSpec::renderingIntentis retained on the value object but is not written into the simplified output. - Finishing maps booleans to XJDF operations: fold to
Folding, staple toStitching, punch toHoleMaking, and trim toTrimming. A non-Nonebinding emits aBindingIntent. - Values are XML-escaped, not otherwise validated. Sanitize externally sourced job names and identifiers before building.
Publication boundary
Section titled “Publication boundary”This page documents externally observable behavior and the supported public API surface only. Internal namespace paths, helper classes, mechanism tables, runbook filenames, and ticket prefixes are out of scope.