DesignCad to Image File Conversion

Using DesignCAD to generate Image Files

DesignCad is a great software package for general purpose drafting. I have used it for over 20 years, since the Dos version 5.0. But, it does not do bitmap images; it is a vector drawing program. So to to get drawing outputs I can use for schematics and illustrations on my website, or to make a negative artwork to make a PC board I needed a method to convert the DesignCad drawing to a bitmapped output file. After trying a bunch of file conversion and virtual printer schemes that gave me so-so results, I settled on this method.

Ghostscript is a neat program that accepts a postcript file and converts it to numerous other file formats. One of the formats is the PNG lossless compression bitmapped image format. Now, my favorite bitmapped image editing program, Irfan View accepts PNG files, so this seemed the way to go. The poscript input file to Ghostscript is easily obtained from DesignCad by using a postscript printer driver and redirecting the driver output to a file using another program, Redmon.

Black-and-White Schematic or Color Line-Art for Screen Display

I actually made three separate printers, one for each type of file I needed from DesignCad. When I want a file to make a black-and-white schematic or a color line art for screen display the process goes like this:

In DesignCAD:

  1. Print drawing.
  2. For schematics, select PNG B&W 100dpi Ghostscript Screen Schematic printer.
    For layout diagrams, select PNG Color 100dpi Ghostscript printer.
  3. AREA:
    Uncheck Fit to Paper. Don't check Print to File.
    Print size: Width: Set to 1/100th width wanted in pixels, e.g. 640px=6.4in.
  4. TYPE:
    For schematics, check Black and White.
    For layout diagrams, uncheck Black and White.
  5. Use Print Preview to see if print might be height limited to 6 inches. If so, change PAPER to Portrait.
  6. Return to the main print screen and print. Save to the desired directory.

In IrfanView:

  1. Open the PNG file.
  2. Rotate and zoom as desired. The schematic will only look right on the screen at a zoom of 100%.
  3. Anchor, drag the rubber band, and select the area to be cropped.
  4. Click Edit > Cropselection.
  5. After crop is done, Save As > [desired filename].GIF for schematics, or [desired filename].JPG for layout diagrams.

Negative for Etching a PC Board

To make a negative for etching a pc board the process is a little different and goes like this:

In DesignCAD:

  1. Save layer with board metal etching (cuts) to a separate drawing.
  2. Select all and make the image a mirror image in black and white.
  3. Make sure image is full size: units =1inch.
  4. Print drawing.
  5. Select PNG B&W 300dpi Ghostscript PC Board printer.
  6. Select Inches Units
  7. AREA: Uncheck Fit to Paper. In Print size Scale: enter 1.
  8. TYPE: In Pen width select 0.25mm. Check Black and White.
  9. Return to the main print screen and print. Save the file to the particular circuit drawing directory.

In IrfanView:

  1. Open the .PNG file.
  2. Zoom out to get the total board image.
  3. Anchor, drag the rubber band, and select the area to be cropped.
  4. Click Edit > Cropselection.
  5. Click Image > Negative.
  6. Click Image > Decrease Color Depth > 2 colors.
  7. Click File > Save As > [desired filename] neg. Select file type. Best Quality is .PNG lossless compression. To e-mail file for remote printer if size is a concern, use .JPG. In JPEG/GIF save options window set [Save quality] to 100.
  8. Close file by exiting IrfanView or opening a new print file.

Making the Virtual Printers

Henrik Schmiediche has written an excellent description of making a PDF printer using Ghostscript. I suggest reading his write up as it contains all the steps with great illustrations. I have followed the format he used to make it easier to perform the steps for a PNG printer. So start here first.

Note that my boot drive is E:. In the examples that follow, most people would need to change the E: to a more conventional C:.

Note also that I have used E:\Program Files\Ghostview. as my directory for the Ghostscript program. This is because I have other programs in this directory to support the program Ghostview. You can name the directory Ghostscript if you like, with appropriate changes to the references below.

Install Ghostscript.

Synopsis: Install Ghostscript to the folder E:\Program Files\Ghostview. After installation, one of the subdirectories will have the version number in it, mine was gs8.54. Note the version number.

Install RedMon

Synopsis: Extract into the E:\Program Files\Ghostview\redmon folder and run the setup file. Do not delete the folder after installation of Redmon.

Create Ghostscript Command Line Script File.

Synopsis: Create the Ghostscript command line script file (e.g. gs-png-100dpi.scr) that gives Ghostscript commands just like they were typed on the invoking command line.

The script to print a black and white, PNG file at 100 dpi for displaying schematic diagrams on my website, is my gs-png-100dpi.scr file:

-I"E:\Program Files\Ghostview\gs8.54\lib";"E:\Program Files\Ghostview\fonts"

The script to print a color, PNG file at 100 dpi for displaying the PC board layout on my website, is my gs-png-100dpi-color.scr file:

-I"E:\Program Files\Ghostview\gs8.54\lib";"E:\Program Files\Ghostview\fonts"

The script to print a black and white, PNG file at 300 dpi for printing PC board etching artwork, is my gs-png-300dpi.scr file:

-I"E:\Program Files\Ghostview\gs8.54\lib";"E:\Program Files\Ghostview\fonts"

The dashes are not for emphasis; they are part of the text.

Put quotes around the paths specification "E:\Program Files\Ghostview \gs8.54\lib";" E:\Program Files\Ghostview \fonts".

The Ghostscript commands are explained at:

Save the Ghostscript command line script file as [scriptfilename].scr in the E:\Program Files\Ghostview folder.

Create the Virtual Printers (WinXP).

Synopsis: Redmon allows the creation of redirected ports. For each virtual printer a redirected port is created and a printer is defined using Ghostscript to produce a .PNG file output.

Using either the Windows Start menu, ot the Control Panel, run the Printers and Faxes Add a printer Wizard:

Check the Local printer attached to this computer option and leave all other items unchecked.

Select Create a new port and choose Redirected Port as the Type of Port.

Do not choose the FILE: or any other port here!

If you are using Windowx XP/2000 and you do not have a Redirected Port as an option then the installation of RedMon (above) failed.

Accept the default Port Name of RPT1:, RPT2:,etc. by clicking OK. Select the default printer to associate with this port.

Select a PostScript printer even if you do not have the printer. I used the HP printer HP Laserjet 5/5M PS for the black-and-white printer. For the color printer I chose the HP Inkjet PS printer. Click on Next until you must name your printer:

Name the printer whatever floats your boat. Don't make it the default printer. Don't make it a shared printer. Don't print a test page.

Configure the Virtual PNG Printer

Synopsis: Configure the newly created virtual PNG printer.

Find the newly created printer in the Printer and Faxes control panel. Right-click on it and select Properties:

Select the tabs of the new printer control panel and make changes as follows:

Select the Advanced tab:

Select Print directly to the printer (this prevents spooling the output to the disk twice).

Select the Device Settings tab:

Set Send CTRL-D After Each Job to No. Also change the Wait Timeout to 1 seconds.

Select the Ports tab:

Click on Configure Port...: and fill out the dialog box as follows:

Make sure the program path E:\Program Files\Ghostview \gs8.54\bin\gswin32c.exe points to the gswin32c.exe executable. Change version 8.54 in the path to match the version that was actually installed.

Make sure the Arguments for this program are: as indicated above (listed here again for reference and easy cut-and-paste):@ "E:\Program Files\Ghostview \[scriptfilename]" -sOutputFile="%1.png" -

Note the space and dash at the end of the line.

The path name after the @ points to the script file and must have a complete path and must be in quotes if there are any spaces in the path.

The .png in the port argument "-sOutputFile="%1.png" automatically adds the .png extension to the output filename when a file is named in the Save As... box.

Make sure Output: is set to Prompt for filename, the Printer: is irrelevant and the Run: box should say Hidden. Click on OK when done.

Note: It may be necessary to check the Run as User box if the user's credentials are necessary to access required resources. For example, writing the PDF file to a network drive may require the users.

Select the General tab:

For the color printer, select Printing Preferences > Paper/Quality > Color > Color >Apply

Select Print Test Page

A dialog box prompting you for the name to give the file being saved will open. Select a location and enter a file name without an extension. The extention ".png" is automatically added. View the newly created PNG file (in this case test.png) with Irfan View.
Copyright Dale Thompson.
Last revised: 3 October 2007.