First some reference points.

Plotter limits

0-10365 0-16640
16.3 x 10.15 inches
1467.00 x 913.50 px

Plotter-units Equivalent Value
1 plotter-unit = 0.025 mm (? 0.00098 inch)
40 plotter-units = 1 mm
1016 plotter-units = 1 inch
3.39 plotter-units = 1 dot at 300 dots per inch

The limits of my actual drawing are:

16" x 10"
16256 x 10160 plotter units
1440 x 900 px

I wrote about getting my HP7475A working before in http://www-personal.umich.edu/~jklaas/plotter/7475A_howto.txt

However, I was frustrated with being able to get a consistent file to print. There have been many improvements since I last tackled this beast.

My goal here is to get a consistent, correctly sized plot from drawings I made in LibreCAD. I wanted ANSI B/Tabloid/Ledger (17x11) sized plots. Unfortunately, LibreCAD has limited ability for output.

Here are all the things I tried.

Export ... to SVG

The output ended up having wierd wiggles in the curves. I believe it was trying to do raster output to SVG vector. I'm not sure the reasoning behind this. I found myself asking this question a lot.

Print to File (Postscript) to pstoedit using the hpgl driver

This was an OK way to go about it. But pstoedit doesn't honor the orientation of postscript files. That means you have to do all sorts of rotation and origin shifting. This is a huge pain in the rear. I ended up with a command line like:

pstoedit -rotate 270 -f hpgl -xshift -758 -yshift -100 floorplan.ps floorplan.hpgl

1 pstoedit unit = 14 plotter units

After each conversion, I would run hp2xx -info floorplan.hpgl and that would tell you the coordinates of the plot:

Coordinate range: (0, 0) ... (16264, 10165)

Print to File (Postscript) to pstoedit using plot-hpgl driver

If you use the hpgl driver in pstoedit, you get a note:

Info: This HPGL/PCL driver is not very elaborated - consider using -f plot-hpgl or plot-pcl instead.

Unfortunately, unlike the hpgl driver, it creates a huge page and puts the plot at some point in the middle with the scaling far off. I'm not sure the reasoning behind this. The only advantage I could see for the plot-hpgl driver was that it exported pens correctly. This command was a nightmare:

pstoedit -rotate 270 -xshift -758 -yshift -100 -xscale 1.4 -yscale 1.4 -f plot-hpgl floorplan.ps floorplan.hpgl

I was never able to get a satisfactory hpgl file using plot-hpgl. Not even with translating from PDF. Less shifting, but all the other issues remained. The output from hp2xx for a PDF file without any shifting or scaling:

Coordinate range: (0, 0) ... (16147, 47520)

Ridiculous.

Print to File (PDF) to pstoedit using hpgl driver

This ended up being pretty good. Orientation was respected by pstoedit and I only had to shift a little bit to deal with the margin added by printing from LibreCAD. I probably could have fussed with LibreCAD to orient the drawing correctly, but this was fine.

pstoedit -f hpgl -xshift -36.3 -yshift -35.4 floorplan.ps floorplan.hpgl

I think I would still need to adjust the size a bit, but that was by far the best I could do with pstoedit.

Print to File (PDF) to Inkscape saving as "HP Graphics Language Plot file [AutoCAD](*.plt)"

This method ended up being the most reproducible method. After I saved the file as a PDF using a Tabloid page size in LibreCAD, I would open it in Inkscape. I'm not sure this did anythinig, but I set the "Precision of approximatating gradient meshes" to the highest I could. You can see file in the preview, but I found that when the file was imported, it appeared blank. Next I selected all, and could see the outline of the plot.

I went to the the Coordinates of the selection in my toolbar, set X and Y to zero. I then set Units to be % and locked W and H and set it to be 80%. Then I went to "Save As..." and picked " HP Graphics Language Plot file [AutoCAD](*.plt) ".

This final method has gotten me the most consistent results. However, using this method doesn't set a pen. I ended up adding: SP1;VS15; after the IN; in the plt file to pick a pen (SP1) and set the speed to 15cm/s (VS15), which I found yielded better results than full speed which is 38.1cm/s.

Adjusting the hpgl using hpglview

One really nice piece of software for viewing plots is hpglview. This program takes a strict reading of hpgl and will not display anything if there is no SP entry as Inkscape does. However, do not count on this software to adjust your hpgl output. I spent way too much time attempting to figure out how to make it do something with no success.

Plotting the results

You can try my old post to set up the communications and it should "just work". However, in practice, I found my plotter would freak out after a bit, since the bits are being pushed much faster than it can handle. I found the Chiplotle (no, not Chipoltle) project. It includes a couple of python scripts that will show the output of your plot. It even allows you to set the model of the plotter in a configuration file and will edit the output of your plot so the plotter doesn't see any commands it wont recognize. For instance, pstoedit produces a larger set of commands than my antique HP7475A can see.

One issue with Chiplotle as of this writing was that it cannot handle hpgl that has no semi-colon delimiter between commands. This is legal syntax and it should handle it, but that's largely my only complaint.

Future dreams

If you look hard enough, you can find the Roland plotter driver files out there for Windows XP. These may even work on 32-bit Windows 7. I am only running 64-bit, so I can't really test. However, I have been excited by the progress the ReactOS community has made in the last year or two. Hopefully, sometime in the not too distant future, I could load the Roland drivers on ReactOS and plot directly from my program of choice to my plotter.

Another dream of mine would be to able to write directly to hpgl from LibreCAD. Unfortunately, I don't have the programming chops to integrate something like Chiplotle into LibreCAD. Ideally, there would even be circle and arc HPGL primitives in a file generated this way. Additionally, LibreCAD seems to not have had any major updates for about a year.