Skip to content

Preflight profiles

A preflight profile is a set of checks to run against a document, optionally with repairs to apply. Kura ships 396 of them under pdfa-engine/profiles/, every one written by BentoPDF from public sources and generated from one script, and it accepts your own.

bash
kura --check --level 2b --profile pdfa-engine/profiles/report/report-hairlines.json in.pdf
json
{"ok":true,"level":"2b","mode":"check","compliant":true,"findings":0,"issues":[],
 "analysis":[
  {"code":"PROFILE_HIT","detail":"Error: Stroke thinner than 0.125 pt (11 hit(s), pages 1-8, 10-12)"}]}

Profile results come back under analysis, separate from the conformance issues, because a profile hit is an observation about the document rather than a standards violation. Each PROFILE_HIT carries the severity, the check name, the hit count and every page it hit, with consecutive pages shown as ranges. A profile with repairs is applied during a conversion:

bash
kura --level x4 --profile pdfa-engine/profiles/press/sheetfed-offset-cmyk-check-and-fix.json in.pdf out.pdf

Each repair that ran is reported as a PROFILE_FIX_DONE issue; one the engine could not run is reported as PROFILE_FIX_UNSUPPORTED and skipped, never silently.

The bundled library

FolderProfilesWhat is in it
profiles/report18report-only profiles: hairlines, small text, rich black, white objects, invisible text, images, spot colours, overprint, transparency, fonts, pages, annotations, layers, ink, document health, and one that runs everything
profiles/press30one check profile and one check-and-fix profile for each print process: sheetfed offset, web offset, newspaper, gravure, flexography, screen, digital toner and inkjet, large format, packaging, labels, book text
profiles/gwg24the Ghent Workgroup 2022 workflows, written from the published specification: PDF/X-4 conformance plus each workflow's resolution, ink, hairline, text, font, colour and page requirements
profiles/online5files meant for screens, downloads, email and phones
profiles/archive13conformance checks for every PDF/A level and for embedded files
profiles/accessibility3the tagged archival levels and an accessibility readiness report
profiles/standards14conformance checks for every PDF/X, PDF/E and PDF/VT flavour
profiles/images37resolution thresholds, compression filters, bit depths, soft masks, interpolation, pixel sizes
profiles/colour46colour spaces, spot colour limits, registration colour, rich black, total ink thresholds, overprint and knockout
profiles/objects50hairlines, small text, render modes, transparency, blend modes, alpha, path complexity, safety margins
profiles/pages40page sizes, empty and rotated pages, boxes, page counts, and the geometry repairs: boxes, bleed, clipping, rotation, scaling to standard sizes
profiles/document72file size, PDF version, encryption, damage, syntax, annotations by type, layers, output intents, fonts, halftones, transfer curves, signatures
profiles/actions44repair-only profiles: rotation, trapped flag, rendering intents, blending space, cleanup of flatness and curves, spot colour merging, overprint and knockout, hairline thickening, stamps, layers, initial view

The browser preflight tool shows a curated 45 of them plus the conversion targets. Every profile comes from pdfa-engine/profiles/build_library.py; the thresholds are named there, so a change to the script regenerates the library.

Writing your own

A profile is JSON:

json
{
  "kura-profile": 1,
  "name": "Report hairlines",
  "description": "Finds strokes too thin to print reliably.",
  "checks": [
    {
      "name": "Stroke thinner than 0.125 pt",
      "severity": "error",
      "all": [
        { "prop": "stroke.width", "op": "<=", "value": 0.125 }
      ]
    }
  ],
  "builtins": [
    { "name": "imageResolutionBelow", "severity": "warning", "params": { "ppi": 300 } },
    { "name": "conformsTo", "severity": "error", "level": "x4" }
  ],
  "fixes": [
    { "op": "increaselinewidth", "params": ["0.25", "", "pt"] }
  ]
}

A check fires when every condition under all holds, or when any group under any holds ("any": [{"all": [...]}, {"all": [...]}]). Conditions compare a property with op against a value: <, <=, ==, !=, >=, >, contains, begins, ends. Booleans compare with true or false; lengths are in points unless the value is a string with a unit, such as "3mm", "1cm" or "0.5in". severity is error, warning or info, and an optional scope of page, trim or bleed limits a check to objects inside that box.

Built-in checks look at the document as a whole and take their thresholds under params; conformsTo and embeddedFilesConformTo take a level instead. Repairs are operations with positional parameters, applied during a conversion rather than a check.

Properties

Graphics state

PropertyMeaning
stroke.widthstroke line width in points
stroke.overprintstroke overprint is on
stroke.transparencystroke is drawn with transparency
stroke.alphastroke constant alpha, 0 to 1
stroke.totalInktotal ink of the stroke colour in percent
stroke.inkCountinks with a non-zero value in the stroke colour
fill.overprintfill overprint is on
fill.transparencyfill is drawn with transparency
fill.alphafill constant alpha, 0 to 1
fill.totalInktotal ink of the fill colour in percent
fill.processInktotal process ink of the fill colour in percent
fill.inkCountinks with a non-zero value in the fill colour
gstate.overprintoverprint is on in the graphics state
gstate.overprintModeIllustratoroverprint mode 1 is set
gstate.transparencythe graphics state uses transparency
gstate.blendModeblend mode name, such as Normal or Multiply
gstate.blendColorspaceblending colour space of the enclosing group
gstate.inTransparencyGroupobject sits inside a transparency group
gstate.hasSoftMaska soft mask is set
gstate.flatnessflatness tolerance
gstate.hasBlackPointCompensationblack point compensation is set

Colour

PropertyMeaning
paint.inkCountinks with a non-zero value in the paint colour
paint.maxInkPercenthighest single ink value in percent
paint.isWhitepaint is white
paint.isBlackOnlypaint uses the black plate only
paint.richBlackCmyPercentCMY added under black, in percent
paint.isRgbDeviceRGB
paint.isCmykDeviceCMYK
paint.isGrayDeviceGray
paint.isIccBasedICC-based colour
paint.isLabLab colour
paint.isCalibratedCalRGB or CalGray
paint.isDeviceIndependentany CIE-based colour space
paint.isSpota spot colour
paint.isSeparationa Separation colour space
paint.isPatterna pattern
paint.isRegistrationthe registration colour
paint.spotNamespot colour name
paint.spotNameHasPantoneSuffixspot name ends in a Pantone suffix
paint.colorspaceNamecolour space family name
paint.altColorspaceNamealternate colour space of a spot
paint.componentCountnumber of colour components
paint.nonZeroCmykCountnon-zero CMYK components
paint.is100Blackexactly 100% black
paint.blackPercentblack component in percent
paint.cmykOnlyprocess inks only, no spots
paint.spotOnlyspot inks only, no process
paint.usesIccCmykICC-based CMYK
paint.usesIccRgbICC-based RGB
paint.processColourAsSpota process ink defined as a spot
paint.processColoursAsDeviceNprocess inks defined through DeviceN
paint.deviceNColorantsnumber of DeviceN colourants

Text

PropertyMeaning
text.sizerendered text size in points
text.isInvisibletext in invisible render mode that is not a clip
text.renderModetext rendering mode, 0 to 7
text.isStrokedtext is stroked
text.isClippingPathtext is used as a clipping path
text.hasUnicodethe glyph maps to Unicode
text.glyphUndefinedthe glyph is missing from the font
text.glyphHasContourthe glyph has an outline
text.glyphIsWhitespacethe glyph is whitespace

Fonts

PropertyMeaning
font.embeddedfont program is embedded
font.notEmbeddedfont program is not embedded
font.namebase font name
font.isType3Type 3 font
font.isTrueTypeTrueType font
font.isCidCID-keyed font
font.subsetCompletethe subset holds every glyph the text uses
font.unicodeCompleteevery character maps to Unicode
font.invalidfont program does not parse
font.notdefUseda character falls back to .notdef
font.bitmapOnlybitmap-only embedding
font.restrictedLicenselicence forbids embedding
font.canBeEmbeddedlicence permits embedding
font.notSubsetfont is embedded whole
font.widthsMatchdeclared widths match the program
font.nameUniquefont name is unique in the file

Images

PropertyMeaning
image.ppieffective resolution in pixels per inch
image.bitsPerComponentbits per colour component
image.bpcsame as image.bitsPerComponent
image.filtercompression filter name, such as DCTDecode
image.widthwidth in pixels
image.heightheight in pixels
image.interpolateinterpolation flag is true
image.hasInterpolateEntryan interpolation entry is present
image.hasSoftMaska soft mask is attached
image.invalidthe image cannot be decoded

Content objects

PropertyMeaning
content.isImageobject is an image
content.isImageMaskobject is a stencil mask
content.isBitmap1-bit image or mask
content.isTextobject is text
content.isLineobject is a line
content.isStrokedobject is stroked
content.isFilledobject is filled
content.isFilledAndStrokedobject is both filled and stroked
content.isStrokedOnlystroked but not filled
content.isShadingobject is a shading
content.outsideMediaBoxentirely outside the media box
content.outsideBleedBoxentirely outside the bleed box
content.insideTrimAndArtBoxinside both trim and art box
content.distanceFromTrimBoxdistance from the trim box in points
content.distanceInsideTrimBoxdistance to the trim edge from inside, in points
content.pathNodesnumber of nodes in the path
content.unknownOperatoroperator no PDF version defines
content.emptyVectorpath that neither fills nor strokes

Pages

PropertyMeaning
page.allHaveMediaBoxevery page has a media box
page.hasMediaBoxpage has a media box
page.hasCropBoxpage has a crop box
page.cropEqualsMediacrop box equals media box
page.isRotatedpage has a rotation
page.isEmptypage paints nothing
page.numberpage number
page.inkCoverageeffective ink coverage of the page in percent
page.singleImagepage holds one image only
page.contentCompressedcontent stream is compressed
page.hasOutputIntentpage carries its own output intent
page.usesPlatespage uses the named plates
page.transparencyGroupHasTransparencypage group actually contains transparency

Document

PropertyMeaning
doc.pagesnumber of pages
doc.fileSizeBytesfile size in bytes
doc.pdfVersionPDF version number
doc.platesnumber of plates
doc.spotPlatesnumber of spot plates
doc.pagesSameSizeall pages share size and orientation
doc.dataAfterEofbytes follow the final %%EOF
doc.spotNamesEquivalenttwo spot names are the same ink
doc.spotNamesNotIdenticalequivalent spot names that are not identical
doc.spotRepresentationsInconsistenta spot is defined differently in two places
doc.xmpIsPlainTextXMP packet is plain text
doc.requiresPdf20file declares a PDF 2.0 requirement
doc.namesUtf8name objects are valid UTF-8
doc.hexStringInvalida hex string has invalid characters
docinfo.creatorCreator field
docinfo.producerProducer field
docinfo.trappedTrapped field, True or False
docinfo.hasPdfxFieldsPDF/X identification fields present

Output intents

PropertyMeaning
outputIntent.countnumber of output intents
outputIntent.hasProfileoutput intent embeds an ICC profile
outputIntent.isPdfxa PDF/X output intent
outputIntent.isPdfaa PDF/A output intent
outputIntent.pdfxEntriesnumber of PDF/X output intents
outputIntent.icc.colorspacecolour space of the output profile
outputIntent.icc.versionICC version of the output profile

Annotations

PropertyMeaning
annot.typeannotation subtype, such as Link
annot.isTypeannotation is of the given subtype
annot.printsprint flag is set
annot.hasOpacityan opacity value is set
annot.opacityopacity value
annot.insideBleedOrTrimannotation lies inside bleed or trim box
annot.unknownTypesubtype the specification does not define

Layers

PropertyMeaning
layers.onLayercontent belongs to a layer
layers.visiblethe layer is on by default
layers.hasConfigsalternate layer configurations exist
layers.processingStepsprocessing-steps metadata
layers.hasProcessingStepsprocessing steps are present

Other

PropertyMeaning
halftone.hasOriginhalftone dictionary fixes an origin
icc.versionICC profile version
icc.colorspaceICC profile colour space
signature.hasFieldsdocument has signature fields
vt.hasDocumentPartsPDF/VT document-part hierarchy present

Built-in checks

NameParametersReports
imageResolutionBelowppicolour and grayscale images below the resolution
imageResolutionAboveppicolour and grayscale images above the resolution
bitmapResolutionBelowppi1-bit images below the resolution
bitmapResolutionAboveppi1-bit images above the resolution
colourPlatesUsedobjects that produce output on the cyan, magenta or yellow plates
deviceIndependentColourobjects painted in Lab, calibrated or ICC-based colour
rgbUsedobjects painted in RGB
spotColoursMoreThancountpages using more spot colours than the count
spotNamesInconsistentspot colours named inconsistently
fontsNotEmbeddedfonts without an embedded program
fontsEmbeddedfonts with an embedded program
type1CidFontsCID-keyed Type 1 fonts
trueTypeCidFontsCID-keyed TrueType fonts
openTypeFontsOpenType fonts
encryptedthe file is encrypted
damagedthe file needed repair to parse
syntaxProblemsstructural problems found while parsing
pdfVersionBelowversionthe file's PDF version is below the value
uncompressedImagesimages stored without compression
pageCountthe page count, always reported
pagesDifferInSizepages differ in size or orientation
emptyPagepages with no visible content
transferCurvestransfer functions in use
halftonescustom halftones in use
postscriptPostScript XObjects
transparencyUsedtransparency anywhere in the file
hairlinesBelowpointsstrokes thinner than the value
conformsTolevelthe file does not conform to the standard; level takes any conformance level Kura converts to or checks, such as 2b or x4
embeddedFilesConformTolevelembedded PDFs that do not conform to the archival level

Repairs

OperationParametersEffect
rotatepagesanglerotates every page by 90, 180 or 270 degrees
removepagescalingremoves the user unit
scalepagesexwidth, height, unitscales pages proportionally to fit the size
setpageboxbox, RelativeToCropBox (or another box), left, bottom, right, top, unit, Alwayssets a page box from another box with offsets; only where missing unless Always
setpageboxesbasedonmarkssets the trim box from the crop box
generatebleedAuto or Amount, amount, unitsets a bleed box around the trim box
removeobjectsoutofboxboxclips content to the box
removepdfuakeysremoves the PDF/UA marker
settitleIfEmpty or Always, titlesets the document title
trappedkeytrue or falsesets the trapped flag
setinitialviewdocumentoptionspage mode, page layoutsets how the file opens, such as UseOutlines and TwoPageRight
setinitialviewuioptionshide toolbar, hide menubar, hide window UIviewer preferences, each true or false
setinitialviewwindowoptionsfit window, center window, display titleviewer preferences, each true or false
settransparencyblendcsCMYK or sRGBsets the page blending colour space
modifyinterpolateentryRemoveremoves the image interpolation flag
removeflatnessremoves flatness tolerances
removesmoothnessremoves smoothness tolerances
transfercurvesremoves transfer functions
removebgremoves black generation
removeucrremoves undercolour removal
removerenderingintentsremoves rendering intents
setrenderingintentintentsets the rendering intent on every graphics state
removeunnecessarytransparencygroupsdrops page groups without transparent content
mergespotcolornamesmerges spot names that differ only in spelling
makecustomspotcolornamesconsistentgives every use of a spot the same definition
mapspotcolorsto, , fromrenames one spot colour to another
convertregistrationcolortoblackrepaints registration colour as black
convertnchtodevnconverts NChannel to DeviceN
placetexttext or Date, , sizeplaces text near the bottom-left of every page
annotationselector, actionselector All, a subtype, AllMultimedia or Unknown; action Remove, SetToNoPrint or MoveOutOfBleedBox
putobjectsonlayername, labelwraps page content in a layer
putobjpstepsname, labelwraps page content in a processing-steps layer
dscdhdnlycntfltnvsblyrsdiscards hidden layers and flattens the visible ones
knockoutwhiteText or emptyswitches overprint off for white objects
overprintblackText or emptyswitches overprint on for 100% black objects
setoverprintandknockoutblack overprint and white knockout together
increaselinewidthwidth, , unitraises thinner strokes to the width
settextrendermodemodeforces a text rendering mode

The XML dialect

Profiles in the XML preflight dialect, with <check name="…" check_severity="…"> and <fixup><fcfg>…</fcfg></fixup> elements, are accepted as well and mapped onto the same engine, so a shop can bring the profiles it already has. Severity in that dialect is numbered the other way round, 0 for error; Kura normalizes it.

In the other surfaces

The npm package and the browser build take the profile text as profile in the options of convert() or check(). The C API does not currently expose profiles.

Provenance

The library was written by BentoPDF from three public sources: the Ghent Workgroup 2022 specifications for the gwg folder, the ISO standards Kura implements for the conformance checks, and standard prepress practice for the thresholds in the print workflows. No third-party profile files were used, and the generator script is the single source of every profile, so the pedigree of each one is visible in the repository. Profiles that reference a Ghent Workgroup specification implement the published requirements; they are not certified by the Ghent Workgroup.

Dual-licensed under AGPL-3.0 and Commercial License.