Skip to content
getnextpdf.com

Pro edition

Print Job — Deep Reference

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.

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.

Terminal window
composer require nextpdf/pro:^3

Entry 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;
}
SymbolParametersDefault behaviorReturnsThrows or fails withNotes
XjdfJobTicket::__constructnonePriority initialized to JobPriority::Normal; copies to 1.instanceFluent builder root.
XjdfJobTicket::setJobIdstring $idRecords the job identifier.selfEmpty value is permitted; see toXml.
XjdfJobTicket::setJobNamestring $nameRecords the human-readable job name.selfEmitted as a GeneralID when non-empty.
XjdfJobTicket::setPriorityJobPriority $priorityOverrides the default Normal priority.self
XjdfJobTicket::setMediaMediaSpec $mediaAttaches a media resource.selfOptional; omitted when unset.
XjdfJobTicket::setColorColorSpec $colorAttaches a color-intent resource.selfOptional; omitted when unset.
XjdfJobTicket::setFinishingFinishingSpec $finishingAttaches finishing resources.selfOptional; omitted when unset.
XjdfJobTicket::setCopiesint $copiesSets the output copy count.selfInvalidArgumentException when $copies < 1Default is 1.
XjdfJobTicket::toXmlnoneSerializes the XJDF 2.1 document.stringGenerates a random XJDF_<hex> job ID when none was set.
MediaSpec::__constructstring $mediaType, float $widthMm, float $heightMm, int $weight, string $coating, string $colorDefaults to A4 white paper at 80 g/m².instanceAll parameters optional.
MediaSpec::isStandardnoneMatches A4, US Letter, or A3 within 0.5 mm.boolPortrait or landscape.
MediaSpec::toXjdfElementnoneEmits a <Media> element; converts millimeters to points.stringOmits coating and color at their defaults.
ColorSpec::__constructbool $useCmyk, bool $useSpotColors, list<string> $spotColorNames, string $renderingIntentDefaults to CMYK, relative colorimetric intent.instance
ColorSpec::colorCountnoneReturns 4 for CMYK plus one per spot color.int
FinishingSpec::__constructbool $fold, bool $staple, bool $punch, bool $trim, string $bindingDefaults to no finishing; binding None.instance
JobPriorityenum cases Idle, Low, Normal, High, RushenumString-backed.
JobPriority::numericValuenoneMaps the case to 0, 25, 50, 75, or 100.intHighest is Rush (100).
  • XjdfJobTicket is a fluent builder. Each setter returns self for chaining.
  • toXml serializes a simplified XJDF 2.1 document under the CIP4 namespace http://www.CIP4.org/JDFSchema_2_0, with Types="ConventionalPrinting".
  • When no job ID was set, toXml substitutes a random XJDF_ identifier rather than failing.
  • Priority is written as both a Comment and a numeric NodeInfo attribute. Copies are written as a Component output 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.
  • setCopies with a value below 1 throws InvalidArgumentException. This is the only exception the module raises.
  • An empty or unset job ID is not an error. toXml substitutes a random XJDF_<hex> identifier at serialization time.
  • Media dimensions are millimeters. toXjdfElement converts them to PDF points using the factor 72 / 25.4.
  • MediaSpec::isStandard applies a 0.5 mm tolerance and accepts portrait or landscape orientation.
  • MediaSpec::toXjdfElement omits FrontCoatings when coating is None and MediaColorName when color is White.
  • The module performs no cryptographic operations. FIPS mode does not change its behavior.

NextPDF Pro emits a simplified XJDF 2.1 subset.

BehaviorReferenceStatus
XJDF 2.1 job-ticket structureXJDF 2.1 (CIP4)Aligned — simplified subset
  • Root and namespace: an <XJDF> element under http://www.CIP4.org/JDFSchema_2_0, with Types="ConventionalPrinting".
  • The color serializer emits NumColors and ColorsUsed. ColorSpec::renderingIntent is retained on the value object but is not written into the simplified output.
  • Finishing maps booleans to XJDF operations: fold to Folding, staple to Stitching, punch to HoleMaking, and trim to Trimming. A non-None binding emits a BindingIntent.
  • Values are XML-escaped, not otherwise validated. Sanitize externally sourced job names and identifiers before building.

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.