- win32 GNU :
- Motivation :
- Cygwin vs Native :
- Apps: Network/Internet :
- Apps: Audio/Video :
- Apps: Graphics :
- Apps: Office/Business :
- Apps: Printing :
- Apps: PDF Printing :
- Apps: GhostPCL :
- Apps: Software Devel :
- Apps: Editors :
- Apps: Utilities :
- Apps: Education :
- App Links :
Apps: Printing - PCL2PDF / GhostPCL Setup
PCL, or the Printer Command Language, is the page description language used by HP printers. The Dos FoxPro apps I reluctantly maintain spit out PCL files on the way to the printer. As some of these reports top a thousand pages, it's often easier to get them electronicly. No one likes a couple of reams of paper dropped on their desk. Plus, these were all created some fifteen years ago in a Dos only environment running on hardware that no longer exists. Lets just say printing has been challenging.
In order to convert the PCL files to PDF files, we use GhostPCL. These are my directions, more for my own reference than anything else, on getting GhostPCL installed. Possibly not the best, efficient or automated way to do it, but it's consistantly worked.
Stuff you need
- Ghostscript: the following assumes it's installed in c:\gs\
- GhostPCL: grab the source code
- 7zip: use this to extract the .tar.bz archive the source comes in...
- Visual C++ v6: arrggg... doesn't seem to compile under MinGW...
Steps
- First and foremost, install ye ole Ghostscript. Make sure to install the fonts... The install path for the rest is assumed to bo c:\gs; the ghostscript version 8.50, AFPL
-
Add (or edit if it already exists) a user environmental vaiable:
PATH
c:\gs; c:\gs\gs8.50\lib; c:\gs\gs8.50\bin
Adjust the path above to reflect your version of ghostscript. - Download GhostPCL. It's in a bzip, so use 7zip to extract it. It will drop the contents in a folder ghostpcl_#### where #### is the current version.
-
Compile it with Visual C++ ... build instructions are here, but a brief run down:
- Open the text file ghostpcl_####\main\pcl6_msvc.mak in Visual C++; allow VC6 to create a new project.
-
Open 'Project' -> 'Settings' and set the 'Build Command Line' as:
NMAKE /f pcl6 msvc.mak DEBUG=1 DEVSTUDIO=c:\progra~1\micros~2
Note: set DEVSTUDIO to the dos short name of your visual studio directory. To get that, open a command prompt, CD to 'Program Files' and type 'dir /x' - Start the build; 'Build' -> 'Build pcl6.exe' (or something similar....)
- Happily ignore 400+ warnings and go find pcl6.exe (usually in the ghostpcl_####\main\obj\ directory)
- Copy pcl6.exe to c:\gs\
- Copy the contents of the ghostpcl_####\urwfonts\ subfolder (a slew of TTF fonts) to c:\gs\urwfonts
- Find the two batch files, pcl2pdf.bat and pcl2pdfwr.bat in the ghostpcl_####\tools folder. Copy these guys to c:\gs\ as well.
-
Open regedit. Head to HKEY_LOCAL_MACHINE\SOFTWARE...
If you installed the GPL version of Ghostscript, look for HKEY_LOCAL_MACHINE\SOFTWARE\GPL GHOSTSCRIPT\####;
if you installed the AFPL version, look for HKEY_LOCAL_MACHINE\SOFTWARE\AFPL GHOSTSCRIPT\####
Again #### is the version number -
Add a new string value (right click in regedit; New -> String Value ) called PCLFONTSOURCE. Double-click it to change the value.
Put the path to the urwfonts you copied. MAKE SURE to use unix style forward-slashes ( / ) AND to end with a forward-slash
c:/gs/urwfonts/ -
Add a user user environmental vaiable called:
PCLFONTSOURCE
c:/gs/urwfonts/
Adjust the path to reflect your install and make sure to both use the unix style forward-slashes ( / ) AND to end with a forward-slash. -
To add and entry to the right-click menu in windows explorer:
- Open regedit again and head to HKEY_CLASSES_ROOT\*\
-
Depending on your windows version there may be a 'shell' entry. If not add it.
Click on 'Edit' -> 'New Key' - Add a new key to shell called 'pcl2pdf' or 'ghostpcl' or 'Convert PCL to PDF' or something equally cool.
-
Add a key under 'pcl2pdf' called 'command'. Set the (Default) value to:
c:\gs\pcl2pdf.bat "%1"
I have noted some issues with paths that contain spaces, but it seems to do the job with most PCL I've sent at it. When trying to debug a 500 page report generated from a 14 year old DOS foxpro app, this thing is worth it's (virtual) weight in gold.