Skip to content

Printer profiles

phil/print-preflight

A PrintProfile holds what one printer asks of a file. Every argument is named and has a default that suits most offset and digital printers; a profile for a given printer sets only what differs.

use Phil\PrintPreflight\Length;
use Phil\PrintPreflight\PrintProfile;
use Phil\PrintPreflight\Size;

$booklet = new PrintProfile(
    trimSizes: [Size::a5()],
    bleed: Length::mm(3),
    safetyMargin: Length::mm(6),
    minimumPages: 8,
    maximumPages: 64,
    pageMultiple: 4,
);

Rules

ArgumentDefaultRule
trimSizes[]The trim sizes the printer prints, each orientation it accepts listed on its own; empty for any size
uniformTrimSizetrueEvery page has the trim size of the first page
bleedLength::mm(3)The bleed each page must carry, and how far past the trim edge an element that bleeds must reach
safetyMarginLength::mm(5)How far inside the trim edge content must stay
minimumResolution150The effective resolution, in pixels per inch, below which an image is an error
targetResolution300The effective resolution below which an image is a warning
maximumResolutionnullThe effective resolution above which an image is a notice, as weight the printer discards; none by default
minimumPages1The fewest pages the printer binds
maximumPagesnullThe most pages it binds; no limit by default
pageMultiple1The page count must be a multiple of it: 2 for a sheet printed on both sides, 4 for saddle stitching
colourWorkflowColourWorkflow::CmykThe colours the printer expects: CMYK, or RGB for services that convert themselves
allowSpotColoursfalseWhether the printer runs spot colour plates
maximumInkCoverage300The total ink coverage, in percent, above which an image or a flat colour is an error, in a CMYK workflow: 300 suits coated paper on an offset press, 260 to 280 uncoated paper, 240 newsprint
minimumLineWidthLength::pt(0.25)The thinnest line the printer reproduces; a thinner one is a warning
allowOverprinttrueWhether the printer honours overprint; when it does not, every element set to overprint is a warning
allowTransparencytrueWhether the printer accepts live transparency, as PDF/X-4 does; when it does not, as with PDF/X-1a, every element that uses it is a warning
severities[]The severity of a rule, by its code, in place of its default
ignore[]The codes of the rules not to report

A profile whose rules contradict each other is refused with InvalidProfile: a negative bleed or safety margin, a minimum resolution that is not positive, a target below the minimum, a maximum below the target, a minimum page count below one, a maximum below the minimum, a page multiple below one, a maximum ink coverage that is not positive, a negative minimum line width.

Severities

Each built-in rule has a default severity (see Checks and findings). A printer that adds blank pages itself makes the multiple a warning; one that never converts colours makes RGB an error; an application that does not want notices about colour ignores them:

use Phil\PrintPreflight\PrintProfile;
use Phil\PrintPreflight\Rule;
use Phil\PrintPreflight\Severity;

$profile = new PrintProfile(
    pageMultiple: 4,
    severities: [Rule::PageCountMultiple->value => Severity::Warning, Rule::ColourRgbInCmyk->value => Severity::Error],
    ignore: [Rule::ColourSpot->value],
);

The keys are codes, not Rule cases, so a profile also sets the severity of the findings of a check the application adds.