The Viewer for HP-GL files


Version 5.00




User’s Guide















A. Matveev

S. Mankov









CERN - Division EST

January, 1999

Viewer for HP-GL files (HpglView)


1.1. New features



Version 5.00 of Designer viewer has many new features in comparison with version 4.00.














1.2. Viewer Software Requirements and Installation



There are versions of the viewer for different systems. You can use the viewer on PC under Windows 95 or Windows NT and on UNIX/Motif workstations.





1.2.1 PC (Windows)


You only need to have the files hpglview.exe and hpglview.dat on your PC and then you can start it under Windows. There are no special hardware requirements but the more memory and power your computer has the faster the viewer will work.


1.2.2 UNIX/Motif



For UNIX workstations you need to copy the files hpglview and hpglview.dat to any convenient place. You must be running Motif window manager. You must set the system variable DISPLAY to your node display by UNIX command:


setenv DISPLAY mynode:0.0



Then your can start Designer viewer. If DISPLAY is not set you will see the message:



Can't open display!



and the program will stop.

You can define environment variable HPGLVIEW with path for hpglview.dat file if

you want to place viewer in search path directory or use link to viewer for viewer start without

typing full path for hpglview.



1.3 Using the Viewer



You can start the Viewer with or without the name of an HP-GL file as parameter. With a file name you will see the name of this file as the title of the viewer window and the file is displayed. Without a file name the viewer window will be clear and will have the title Designer viewer V5.00.


It's possible to start the viewer in batch mode. There follows the command line options:


hpglview [input_name[,low_x[,low_y[,size_x[,size_y]]]]]

- file visualization in defined in millimeters window;


hpglview -hpgl input_name[,cfg_file_name] output_name[,rotate[,scale]]

- converts file to HP-GL format;


hpglview -hpgl2 input_name[,cfg_file_name] output_name[,rotate[,scale]]

- converts file to HP-GL/2 format;


hpglview -eps input_name[,cfg_file_name] output_name[,rotate[,scale]]

- converts file to Encapsulated PostScript;


hpglview -ps input_name[,cfg_file_name] output_name[,rotate[,scale]]

- converts file to PostScript format;


hpglview -dxf input_name[,cfg_file_name] output_name[,rotate[,scale]]

- converts file to DXF format;


hpglview -cgm input_name[,cfg_file_name] output_name[,rotate[,scale]]

- converts file to CGM format.


'rotate' can be 0, 90, 180, 270 degrees, scale can be any number > 0.

hpglview -link input1[,cfg_file] input2[,dX[,dY[,scale]]] ... output[,format]

- links input1 with input2 shifted on dX, dY millimeters and scaled and saves to output in selected format.


hpglview -clip low_x[,low_y[,top_x[,top_y]]] input[,cfg_file] output[,format]

- clips window with coordinates low_x, low_y, top_x, top_y in millimeters from low left corner of drawing and saves it to output_name file in desired format.

Format can be hpgl, hpgl2, eps, ps, dxf, cgm.


hpglview -text input[,cfg_file] textfile[,dx[,dy[,orig[,adj]]]] output[,format]

- adds textfile shifted on dx,dy millimeters from orig (0 - left bottom, 1 - left top, 2 - right top, 3 - right bottom corner) with adjustment adj (l - left, c - center, r - right) to input with parameters from cfg_file and saves to output in selected format.


[ ] mean that parameter is optional.



The viewer has a basic dialog bar menu at the top of its window.

Toolbar Mark up toolbar


Error indicator Status bar

1.3.1 Dialog Tree


The viewer dialog has the following menu structure:


File Edit View Window Help

Open Delete block Zoom + New About


Add Fit block Zoom -- Close Index

Tree… Mark up Previous page Lens window Log file

Save Options Next page

Save as… Previous view

Printer setup… Next view

Print Extents

Exit Redraw



Highlight blocks


Hide blocks


Show blocks


1.3.2 File Menu



Using this menu you can open other HP-GL files, add file as block, save drawing in different formats, change printer settings, print file or exit from Designer viewer.

Open option and open file button in toolbar let open a new file in current viewer window. If zoom window is defined the new file will be fitted in it. In other cases the file will be fitted to the whole viewer window.

Open has a submenu which has different forms for different systems but usually using this submenu is very simple and doesn't require additional explanations because it uses common dialog boxes for each platform.


Add option and add button in toolbar let you add another file as a block to the current page of the current file. If zoom window is defined the file will be fitted to this window. If not, the file will be fitted to the current drawing window.


Tree… option loads file tree dialog. With this dialog you can navigate through your files and visualize them just by clicking to the file name.


Save option save modified file with the same name and format.

Save as… option lets you save the file in different formats. The viewer always saves the current drawing window. So what you see is what you will have in the saved file. If you want to save all don't forget to set the drawing window to extents. Also if you save a drawing in monochrome mode all information about colors will be lost.

If you save a file in HP-GL or HP-GL/2 formats all information about pages, visible and hidden blocks will be saved. Then if you plot the saved file you will not see the hidden blocks on paper. But you can open this file and make hidden blocks visible in any time.

If you save a file in Encapsulated PostScript, PostScript, DXF or CGM format the current page will be saved only. File in PostScript format will be fitted to the paper size of any PostScript device to which you send it.


By using Printer setup submenu on UNIX platforms you can set the command line for printing and select the format for output file. Designer viewer currently supports three formats: HP-GL, HP-GL/2, PostScript. Designer viewer lets you execute up to 5 system commands after saving output file. You only need to activate the corresponding item in this submenu.

For Windows this option loads standard Windows Page setup dialog window.


On UNIX platforms Designer viewer always prints the contents of its window, i.e. what you see in viewer window is what you get on paper (including color/monochrome mode and on/off pens thickness). You can print any part of your drawings by changing your view window. If you want to print the whole drawing it is a good idea to use Proportional window from View menu.

For Windows version Print option loads the following print dialog:



Exit option stops the viewer and closes all viewer windows. If you didn't save any modified file all this information will be lost!!!


1.3.3 Edit Menu

Delete block option and delete block button in toolbar let you remove all selected blocks. Be careful, there is no undo option in the viewer for this function!!!


Fit block option lets you fit all selected blocks to the zoom window if it is defined or to the current drawing window if not.


Mark up option and mark up button in the mark up toolbar switch on/off mark up mode.



In this mode you can place your own text in the drawing by clicking the left mouse button where the text should start. If zoom window was defined before switching on the mark up mode this rectangle will be drawn and the line from this rectangle to the text start point will be drawn. Text will be adjusted in correspondence with this line direction. The most convenient way to place a text in this case is to press left mouse button, then place the mouse pointer to the text start point and release mouse button. In this case you can see the direction of the line during mouse movement. All markups are separate blocks so it's possible to hide and show them again or remove them as blocks.


Options… position loads dialog where you can set options for mouse, measurement units,

parameters for HP-GL pens, HP-GL/2 pens, mark up and your preferences. Options Dialog Window


Mouse option and mouse options buttons in toolbar let you select the mouse mode.





You can define zoom window in this mode. Press left mouse button in one corner of desired area then move mouse to opposite corner and release button.


You define zoom window in this mode as in mouse zoom window mode. But after the button is released the defined zoom window will be automatically fitted to the viewer window as for zoom increasing option.


Place mouse pointer to drawing point you want to move. Press the left mouse button and move mouse pointer to new point location. After the mouse button is released the drawing will be panned so that your point will be placed to the new location.


Place and click the mouse pointer to the point you want placed in the center of viewer window.


Place and click the mouse pointer to the point of origin for the coordinates display.


You can select/unselect blocks in this mode. Just click the mouse on the block which you want to select/unselect. If there are several overlapped blocks in the same area the block with a line or point nearest to mouse pointer will be selected/unselected.


You can measure distance in this mode. Press left mouse button in first point and move mouse pointer to second point. You will measure distance between these points in selected units.


This is a modificator of mouse behavior for zoom window and pan vector defining. If clinging is on, the zoom window and the pan vector will be changed to the nearest drawing points.




Units option lets you select units for coordinates display and distance measuring.


HP-GL pens settings option loads pens settings dialog for HP-GL pens where you can set pens colors and thickness and also switch off/on some pens.


HP-GL/2 pens option loads pens settings dialog for HP-GL/2 pens where you can switch off/on some pens. Colors and thickness for HP-GL/2 pens defines in drawing file or have default values as HP-GL/2 requires.


Mark up option lets you hide/display mark up toolbar and set all parameters for mark up text.



Preferences option



Background option lets you select background color for drawings.


Interface option gives you the possibility to choose between different interface images.


Monochrome/color mode option and monochrome/color mode button in toolbar let you switch between monochrome and color display modes.


Disable/enable thickness option and disable/enable thickness button in toolbar let you switch off/on line thickness for drawings.


Dynamic lens option lets you switch on/off dynamic lens mode. In dynamic lens mode if you drag scroll bars or zoom window, the contents of the viewer window and lens window will be dynamically changed.


Save in CGM with background option lets you switch on/off background in CGM output file.


Output scaling option set scale factor for output files.


When you save options the viewer current window and lens window sizes and positions will be saved also.


1.3.4 View Menu


This menu lets you change the display of the drawing in the window. It has the following items:


Zoom increasing tool button and Zoom + position let you increase zooming to 1.5 times or to fit zoom window to viewer window if zoom window was defined before.


Zoom reducing button in toolbar and Zoom -- option let you reduce zooming to 1.5 times or to fit current drawing window to zoom window if it was defined before.


Previous page option and previous page button in toolbar switch viewer window to previous page in multipage files.


Next page option and next page button in toolbar switch viewer window to next page in multipage files.


Previous view option and previous view button in toolbar draw the previous user view.


Next view option and next view button in toolbar draw the next user view.


Extents option and extents button in toolbar fit drawing extents to viewer window so it's possible to see whole drawing.


Redraw option just redraws current drawing window. It may be useful from time to time.


Rotate option and rotate buttons in toolbar let you rotate drawing in steps of 90 degrees.


Proportional option lets you to set viewer window size so that current drawing window will be fitted exactly to viewer window.


Highlight/conceal blocks option lets you draw or conceal blocks borders so it's possible to see all blocks. Highlighting is very useful if you want to select hidden blocks for making them visible or removing them. It's impossible to select a hidden block if you do not see it and don't know exactly where it is placed.


Hide blocks option lets you make invisible all selected blocks.


Show blocks option lets you make visible all selected blocks.


1.3.5 Window Menu


New option and open new window button in toolbar create new empty viewer window. You can open another drawing in this window. The number of windows is not limited inside the viewer. It's only limited by the resources of your computer.


Close option closes current viewer window. If you made modifications of drawing and didn't save it all will be lost!!!


Lens window option and lens window button in toolbar open/close separate lens window if zoom window is defined. When lens window is open you can move zoom window with the mouse through drawing and look at different parts of it.




1.3.7 Help Menu


About option gives you information about Designer viewer version and authors.


Index option loads indexed help dialog window where you can quickly find information about viewer options and possibilities.





Log file option opens window with file statistic information or with information about error if error indicator in status bar is red.





1.3.8 Toolbar


Toolbar buttons give you fast access to often used viewer functions.



1.3.9 Status bar


Status bar shows current mouse pointer coordinates, current page number and rotation angle in degrees. If there were no errors during file reading the error indicator is green. It is red in opposite case.



  1. Mark up toolbar



Apart from the markup on/off switch, this toolbar has the following options:


let you set text size for mark up text. Text size is always set in millimeters and by default is equal 3.75 mm. You can save your preferred text size by saving options.


let you set the desired pen number for marking your drawings.


let you type the mark up text.



  1. Work with pens settings



There is a difference in work with pens between HP-GL and HP-GL/2. In fact there is no information about pens colors and thickness in HP-GL. So for HP-GL files viewer uses user settings from the option menu. But these settings have no matter for HP-GL/2 files. For these files viewer uses colors and thickness, which were set inside file or by default for HP-GL/2 format. If you will convert HP-GL/2 file to HP-GL you will lose this information. But if you will convert HP-GL to the HP-GL/2 you will store current pens settings for HP-GL pens to the file. Information about file format you can find in log file window from Help option of bar menu.