Что такое формат файла HPG?
.hpg is an HP-GL plotter file - a plain-text vector drawing stored as a stream of two-letter HP Graphics Language commands directed at a pen plotter or cutting machine. HP-GL was introduced by Hewlett-Packard in the late 1970s for its range of pen plotters; the extended dialect HP-GL/2, which added polylines, fill types, scalable fonts and RTL raster passthrough, arrived in the 1990s and is the version most software produces today.
The file contains ASCII mnemonics such as IN (Initialize), SP (Select Pen), PU (Pen Up), PD (Pen Down) and PA (Plot Absolute). There is no fixed binary signature - a .hpg file typically begins with IN; or, for HP-GL/2 streams, an escape prefix %-12345X (the PCL/PJL Universal Exit Language sequence). Because the format is pure ASCII text, file size scales with drawing complexity rather than canvas area.
.hpg is one of several interchangeable extensions for the same language: .PLT, .hpgl, .hgl and .gl2 files are structurally identical. A CAD application that plots to file may also write PostScript or PCL under a .hpg name depending on the chosen driver, so inspecting the opening bytes before processing is advisable.
True pen plotters are now rare, but HP-GL remains the native command language of vinyl cutters, laser cutters and some wide-format devices. For archiving or sharing technical drawings, converting to SVG, PDF or DXF is recommended.
Безопасность и защита
РИСК: LOWHP-GL .hpg files are plain-text command streams and are not executable, so they pose little direct risk. The practical pitfalls are non-security: an .hpg may not actually be HP-GL (it can be PostScript or PCL from a CAD print driver), so a viewer may show nothing - check the contents. Avoid sketchy "free HPGL converter" download portals bundling adware/PUPs; prefer the reputable viewers above or browser-based converters, and don't upload confidential engineering drawings to unknown online services.
Детали формата
в двух словахПрограммы, открывающие файлы HPG
Технические подробности
глубокая спецификация| File encoding | 7-bit ASCII plain text; no binary sections in standard HP-GL; HP-GL/2 RTL raster blocks may embed binary pixel data within the same stream |
| Command syntax | Two-letter uppercase mnemonics followed by optional numeric parameters and a semicolon terminator - e.g. `SP1;`, `PD100,200;`, `PA500,300;` |
| MIME type | `application/vnd.hp-hpgl`; alternative `application/hpgl` |
| File signature | No registered magic bytes; standard HP-GL begins with `IN;`; HP-GL/2 streams are prefixed with ESC `%-12345X` (PCL Universal Exit Language sequence) |
| Coordinate units | Plotter Units (p.u.); default resolution is 40 p.u. per millimeter (0.025 mm precision); overridden per job by the `SC` (Scale) command |
| Dialects | HP-GL (original, late 1970s): basic pen moves, lines and arcs; HP-GL/2 (1990s): adds filled polygons, line-fill types, scalable fonts and RTL raster passthrough |
| Color model | Pen-based: color is assigned by pen number via `SP` (Select Pen); HP-GL/2 adds the `PC` (Pen Color) command for direct RGB assignment to each logical pen |
| Pen capacity | HP-GL/2 supports up to 256 logical pens (`SP1`-`SP256`); each pen carries its own color, width and fill pattern assignment |
| Text and label support | HP-GL `LB` command embeds text labels in the drawing; HP-GL/2 adds `SD`/`CF`/`DT` instructions for scalable font selection, character spacing and label terminators |
| Compression | None; the command stream is stored uncompressed; HP-GL/2 RTL raster sections may optionally use PCL compression modes within their binary blocks |
| Scalability | Fully resolution-independent vector; scales to any physical output size without quality loss, bounded only by the plotter's page-size setup |
| Typical file size | A few kilobytes for simple diagrams up to several megabytes for dense engineering drawings; size grows with path complexity, not canvas dimensions |
| Interchangeable extensions | `.plt`, `.hpgl`, `.hgl`, `.gl2` and `.prn` carry the identical HP-GL language; extension choice is application convention only, not a format difference |
| Platform support | Windows, macOS and Linux via third-party viewers and converters; interpreted natively by pen plotters, vinyl cutters and laser cutters |
| Выпущен | HP-GL late 1970s; HP-GL/2 1990s |
| Последняя версия | HP-GL/2 (with RTL extensions); language effectively frozen |
| Открыть стандартное | Да · без роялти |
| Спецификация | en.wikipedia.org |
Конвертации HPG
Вопросы и ответы сообщества
спрошено пользователямиВопросов пока нет - станьте первым, кто спросит о файлах HPG.