NAME

Graphics::Penplotter::GcodeXY::Postscript - EPS export role for GcodeXY

SYNOPSIS

$g->exporteps('output.eps');

DESCRIPTION

A Role::Tiny role that adds the exporteps method to Graphics::Penplotter::GcodeXY. The generated file is a DSC 3.0 compliant Encapsulated PostScript document, suitable for embedding in LaTeX, Inkscape, LibreOffice, and commercial print workflows.

Key properties of the output:

  • %%BoundingBox contains integer values (floor of min, ceil of max) as required by the DSC specification.

  • %%HiResBoundingBox carries the full-precision floating-point values.

  • No showpage -- EPS files must not call showpage.

  • No setpagedevice -- EPS files must be device-independent.

  • All required DSC structural comments are present: %%EndComments, %%Trailer, %%EOF.

METHODS

($llx, $lly, $urx, $ury) = exporteps($filename)

Write the current drawing to $filename as EPS. Returns the bounding box in PostScript points as a four-element list (matching the return convention of exportsvg).

The optional object attribute eps_linewidth controls the line width in points (default 0.3pt).

REQUIRED METHODS

This role requires the consuming class to provide: _parse, _flushPsegments, _checkp, _checkl.

AUTHOR

Albert Koelmans (albert.koelmans@googlemail.com)

LICENSE

Same terms as Perl itself.