Documentation

    Table of Content
    • 3D File Formats
      • 3D File Formats
      • 3D2
      • 3DS
      • 3MF
      • AMF
      • ASE
      • DAE
      • DRC
      • FBX
      • GLB
      • GLTF
      • JRXML
      • JT
      • OBJ
      • PLY
      • PRC
      • RVM
      • STEP
      • U3D
      • VRML
      • X
      • X3D
    • Audio File Formats
      • Audio File Formats
      • AAC
      • FLAC
      • M3U
      • MID
      • MKA
      • MP3
      • OGG
      • RA
      • SDT
      • STAP
      • WAV
    • CAD File Formats
      • CAD File Formats
      • CF2
      • DC3
      • DGN
      • DWF
      • DWFX
      • DWG
      • DWT
      • DXF
      • HPGL
      • IFC
      • IGES
      • IGS
      • JVSG
      • NWC
      • NWD
      • NWF
      • PAT
      • PHJ
      • PLT
      • PSM
      • PSS
      • RVT
      • STL
    • Compression File Formats
      • Compression File Formats
      • 7Z
      • ARC
      • ARJ
      • BZ2
      • DAA
      • GZ
      • RAR
      • TAR
      • ZIM
      • ZIP
    • Database
      • Database File Formats
      • ACCDB
      • ACCDE
      • ACCDT
      • ACCFT
      • BAK
      • BCP
      • DDL
      • DTSX
      • LDF
      • MDB
      • MDF
      • MYI
      • NDF
      • NSF
      • SQL
      • SQLITE
    • EBook File Formats
      • EBook File Formats
      • AZW
      • AZW3
      • EPUB
      • FB2
      • KFX
      • LRF
      • LRS
      • LRX
      • MOBI
      • TR
    • Email File Formats
      • Email File Formats
      • EDB
      • EML
      • EMLX
      • ICS
      • MBOX
      • MSG
      • OFT
      • OST
      • PST
      • TNEF
      • VCF - Virtual Contact File
    • Font
      • Font File Formats
      • CFF
      • CFF2
      • EOT
      • FNT
      • FON
      • JFPROJ
      • OTF
      • PFA
      • PFB
      • PFM
      • SFD
      • TTF
      • WOFF
    • GIS File Formats
      • GIS File Formats
      • E00
      • FileGDB
      • GeoJSON
      • GML
      • GPX
      • KML
      • KMZ
      • OSM
      • SHP
    • Image File Formats
      • Image File Formats
      • AI
      • APNG
      • AVIF
      • BMP
      • BPG
      • CDR
      • CMX
      • CPC
      • DCM
      • DIB
      • DICOM
      • DJVU
      • DNG
      • EMF
      • EMZ
      • EXIF
      • FLIF
      • GIF
      • ICO
      • J2K
      • JFIF
      • JP2
      • JPEG
      • JXR
      • ODG
      • OTG
      • PNG
      • PSB
      • PSD
      • SVGZ
      • TGA
      • TIFF
      • VDX
      • VSD
      • VSDM
      • VSDX
      • VSS
      • VSSM
      • VSSX
      • VST
      • VSTM
      • VSTX
      • VSX
      • VTX
      • WEBP
      • WMF
      • WMZ
    • Note Taking File Formats
      • Note Taking File Formats
      • ONE
      • ONETOC2
    • Page Description Language
      • Page Description Language
      • CGM
      • EPS
      • PCL
      • PS
      • SVG
      • SWF
      • TEX
      • XPS
      • XSLFO
    • PDF
      • PDF
      • PDF/A
      • PDF/E
      • PDF/UA
      • PDF/VT
      • PDF/X
    • Presentation File Formats
      • Presentation File Formats
      • ODP
      • OTP
      • POT
      • POTM
      • POTX
      • PPS
      • PPSM
      • PPSX
      • PPT
      • PPTM
      • PPTX
    • Programming
      • Programming
      • C
      • Class
      • CPP
      • CS
      • CSPROJ
      • Dart
      • H
      • JAR
      • Java
      • KT
      • MF
      • PDB
      • PHP
      • PY
      • SH
      • SLN
      • SWIFT
      • TOML
      • VB
      • VBPROJ
      • VCXPROJ
      • YAML
    • Project Management File Formats
      • Project Management File Formats
      • MPP
      • MPT
      • MPX
      • XER
    • Spreadsheet File Formats
      • Spreadsheet File Formats
      • CSV
      • DIF
      • ODS
      • OTS
      • TSV
      • XLAM
      • XLM
      • XLS
      • XLSB
      • XLSM
      • XLSX
      • XLT
      • XLTM
      • XLTX
    • Video File Formats
      • Video File Formats
      • 3G2
      • 3GP
      • AVI
      • F4V
      • FLV
      • M4V
      • MKV
      • MOV
      • MP4
      • RM
      • RMVB
      • RV
      • SRT
      • VOB
      • WMV
      • Xvid
    • Web File Formats
      • Web File Formats
      • ASP
      • ASPX
      • CHM
      • CSS
      • HTM
      • HTML
      • JS
      • JSON
      • MHTML
      • Sass
      • SCSS
      • VDW
      • XAML
      • XHTML
      • XML
      • XOML
      • XSLT
    • Word Processing File Formats
      • Word Processing File Formats
      • DOC
      • DOCM
      • DOCX
      • DOT
      • DOTM
      • DOTX
      • MD
      • ODT
      • OTT
      • RTF
      • TXT

    What's on this Page

      • What is a HPGL file?
        • HPGL Command
        • HPGL Command Example
        • Coordinate System
      • HPGL File Format
      • References
    1. Home
    2. CAD File Formats
    3. HPGL

    What is a HPGL file?

    An HPGFL(Hewlett-Packard Graphics Language) file contains instruction set for plotter control by developed by HP. HP plotters use this file to draw and print vector and raster content on the paper.

    HPGL Command

    An HPGL command consists of the following.

    • A command section of the alphabet of two characters
    • A parameter section
    • Terminator section

    Each parameter in the file has to be devided with a separator in case of multiple parameters.

    HPGL Command Example

    Example :PA5000,1000;
      (command)    PA
      (parameter)  5000
      (separator)  ,
      (parameter)  1000
      (terminator) ;
    

    Coordinate System

    Coordinates systems comprises of 2-dimensional measurement indicators to locate any specific location. The HPGL uses both Plotter coordinate and user coordinate system for this purpose.

    Plotter Coordinate System

    This coordindate system is used to plot drawings based on plotter movement. A typical XY unit of minimum plotter movement is 0.025mm. The possible range of drawing changes with plotter kinds.

    User coordinate system

    User specified coordinate system can be set up using the scale and origin. These are converted to plotter coordinates using the IP command and SC command. Plotter system coordinates are used by default if this conversion is not carried out.

    HPGL File Format

    HPGL files are in ASCII (text file) format and start with few setup commands. This sets up certain parameters for the plotter for plotting. A typical HPGL file looks as follow.

    CommandMeaning
    IN;initialize, start a plotting job
    IP;set the scaling points (P1 and P2) to their default positions
    SP1;select pen 1
    PU0,0;lift Pen Up and move to starting point for next action
    PD100,0,100,100,0,100,0,0;put Pen Down and move to the following locations (draw a box around the page)
    PU50,50;Pen Up and move to X,Y coordinates 50,50
    CI25;draw a circle with radius 25
    SS;select the standard character set
    DT*,1;set the text delimiter to the asterisk, and do not print them (the 1, meaning “true”)
    PU20,80;lift the pen and move to 20,80
    LBHello World*;draw a label

    References

    • HPGL by Wikipedia
    • HPGL Reference Guide

    See Also

    • CF2 File Format
    • DWF File Format
    • DWFX File Format
    • DWG File Format
    • DC3 File Format