cupstestdsc
Test and validate PostScript Printer Description files
SYNOPSIS
cupstestdsc [-q] [-s] [files...] | stdin
PARAMETERS
-q
Quiet mode: suppress non-error output (warnings still reported)
-s
Strict mode: enforce full DSC conformance (default is lenient)
--help
Display usage information and exit
--version
Display version information and exit
DESCRIPTION
The cupstestdsc command is a utility from the CUPS printing system designed to validate PostScript files against Adobe's Document Structuring Conventions (DSC). DSC is a set of conventions for structuring PostScript documents, enabling features like page independence, bounding boxes, and prologs/epilogs.
cupstestdsc reads one or more PostScript files or standard input, parses the DSC comments, and checks for compliance. It operates in two modes: lenient (default), which tolerates minor issues common in real-world files, and strict (-s), which enforces exact adherence.
Common issues detected include missing document header, malformed bounding boxes, unbalanced save/restore, improper page ordering, or invalid prolog/setup/body structure. Output lists errors and warnings with line numbers for easy debugging.
Primarily used by print administrators and developers to ensure PostScript jobs process correctly on CUPS servers or PostScript interpreters like Ghostscript. It does not execute the PostScript code, only syntax-checks DSC elements, making it fast and safe.
Exit status indicates success (0: no issues), warnings (1: DSC problems), or failure (2: fatal errors). Ideal for scripting in print workflows.
CAVEATS
Does not validate PostScript syntax or execute code; only checks DSC structure. May false-positive on non-standard or encapsulated PostScript (EPS). Use with cupstestpp for full testing.
EXIT STATUS
0: No errors or warnings
1: DSC warnings detected
2: Fatal errors (invalid structure)
EXAMPLE
cupstestdsc -s document.ps
Reports: "line 5: Bad bounding box" if issues found.
HISTORY
Developed for CUPS 1.1 (2001) by Easy Software Products (now OpenPrinting). Evolved with CUPS versions; strict mode added early for Adobe compliance. Maintained in CUPS 2.x+ for legacy PostScript support.
SEE ALSO
cupstestpp(1), cupsfilter(8), gs(1)


