1. quit

Terminates operation of the PostScript interpreter.

1.1. Syntax

– quit → –

1.2. Stack Effects

Table 1. Before/After
Level Object

(none)

Interpreter terminates

1.3. Description

quit terminates operation of the PostScript interpreter. The precise action depends on the environment:

  • May return control to operating system

  • May halt or restart the machine

  • In multi-context systems (DPS): terminates current context only

In job server environments, quit in userdict is usually redefined to mean stop (terminate job, not interpreter).

1.4. PostScript Level

Level 1 and later

1.5. Examples

Terminating interpreter
% After all processing
showpage
quit
In userdict (job server)
% userdict /quit is typically:
/quit { stop } def

quit  % Ends job, not interpreter
Accessing systemdict quit
systemdict /quit get exec  % True interpreter termination

1.6. Common Use Cases

1.6.1. Script Termination

% At end of standalone script
cleanup
quit

1.6.2. Conditional Termination

fatalError {
  (Fatal error - terminating) print
  quit
} if

1.7. Common Pitfalls

userdict Redefinition - In job server environments, userdict /quit is usually redefined.
quit  % Usually stops job, not interpreter
systemdict /quit get exec  % Actually quits
Immediate Termination - quit terminates immediately, no cleanup.
{
  openResources
  quit  % Resources not cleaned up!
} stopped {
  cleanup
} if
Use stop in Jobs - In encapsulated jobs, use stop instead of quit.

1.8. Error Conditions

Error Condition

[invalidaccess]

In encapsulated job, accessing systemdict quit

1.9. Implementation Notes

  • In DPS: terminates context immediately

  • In job servers: userdict version usually shadows systemdict

  • Standard quit in systemdict requires unencapsulated job

  • Termination is immediate (no cleanup)

1.10. Job Server Behavior

In environments with job control:

% userdict typically contains:
userdict /quit { stop } put

% So:
quit              % Stops current job
systemdict begin
  quit            % Actually quits interpreter
end

1.11. See Also

  • stop - Terminate stopped context

  • exit - Exit loop

  • stopped - Error catching


Back to top

Copyright © 2025 Ribose. PostScript is a trademark of Adobe. Distributed under the MIT License.