Creating PDF Files
This article briefly reviews a free and accessible method for the creation of PDF files. If you are using AutoCAD 2007, there is a dedicated plotter for doing this. Rather than sending your drawing to the physical plotter, send it to the 'DWG To PDF.pc3' device and you are set.
Copyright©2000-2007 ActiveDwg.com
Adobe Portable Document Format, or PDF, is one of the preferred file formats for distributing files to outside users who may not
have access to AutoCAD. Because Adobe encourages the use of PDF, anyone can get and use the freely available PDF viewer,
Adobe Acrobat Reader. There are many general purpose PDF creation programs available in a wide price range. One of our favorites
is FreePDF [Download]-[website] which, once configured, works quite well. Another alternative is, of course,
Adobe Acrobat, the original that comes with a lot of bells and whistles and a hefty price tag to boot.
We do not always need all the bells and whistles and, as easy as it is to use, the added layers used by FreePDF.
Here we will explore another alternative which requires only Ghostscript, the freely available PostScript engine, a PostScript plotter
driver, and a bit of configuration. While a lot of PDF creation systems redirect printer output to a special port, namely RedMon, we
will plot our drawings to file using the PostScript printer and then use GhostScript to distill the resulting .PS file into a
PDF document.
Setting Up to Make PDF Files:
Here are the steps we will need to follow to get ready to make PDF files:
1) Obtain and install Ghostscript,
2) Obtain and install a PDF file viewer,
3) Create and configure an AutoCAD PostScript plotter,
4) Create and configure a batch file to process the PostScript files,
5) Configure Windows to properly recognize and process the PostScript files.
1) Obtain and install Ghostscript: Ghostscript is a freely available software
set for interpreting and processing postscript and PDF files, among others. You can
obtain the latest version at the Ghostscript
home page. The latest version is listed at the top of the page. When you
click on the version link you are taken to the download page for that version
where you are given several operating system options. Click the correct option
link to download the executable. Note that you will also see a link for
Ghostview, which provides a graphical interface for the command-line
driven Ghostscript. Although it is a nice touch for other purposes, we do not
need Ghostview for our set up. With the executable downloaded, install
Ghostscript in its default folder, 'C:\gs', by browsing to and clicking on the
downloaded file.
2) Obtain and install a PDF file viewer: We use the original, Adobe
Acrobat Reader, available at Adobe's Reader page.
Follow the Adobe instructions for installation. If you have an alternate viewer
you prefer, by all means use it.
3) Create and configure an AutoCAD PostScript plotter: AutoCAD comes
with several HDI PostScript drivers, so we will use one of those. Go to 'Start
> Control Panel > Autodesk Plotter Manager' and create a new plotter by
using 'Add-A-Plotter Wizard > My Computer > PostScript Level 1 > Next
> Plot to File > Next > Finish'. The only configuration change to make
is to go to the new plotter, go to 'Device and Document Settings > Custom
Properties' and change the 'Default plot to file extension and format' from 'EPS
- Encapsulated PostScript' to 'PS - PostScript' (strictly speaking, you do not HAVE
to make this change, but it will normalize the resulting PDF file name). Note
that the HDI PostScript drivers may give inconsistent paper size results in the
viewer. If that is the case you may wish to install an alternate Windows printer
driver, such as a Xerox 8825 with PostScript support and use that for the
AutoCAD plotter.
4) Create and configure a batch file to process the PostScript files: In
Windows Explorer browse to the Ghostscript folder and create a new folder within
it named 'MakePDF'. Next, open Windows NotePad or another plain text editor
and insert these lines:
cd c:\gs\gsX.XX\lib
c:\gs\gsX.XX\lib\ps2pdf14.bat "%1"
Note that you need to replace 'X.XX' in these lines with the appropriate version for you installation.
Now save the file as 'c:\gs\MakePDF\ps2pdf.bat' and close it.
5) Configure Windows to properly recognize and process the PostScript files:
In Windows Explorer (this is for XP, others may be slightly different) select
'Tools > Folder Options... > File Types' from the pull-down menus:
a) Click the 'Extensions' column head to sort the types by 'Extension',
b) Scroll down to extension 'PS', highlight it, and click the 'Advanced'
button (if there is no 'PS' extension listed, we will create one, see '5e'
below),
c) This will open the 'Edit File Type' dialog. Click the 'New...' button
next to the 'Actions' list box. Type 'Make PDF' in the 'Action:' field and 'c:\gs\MakePDF\ps2pdf.bat' in the
'Application used to perform action:' field (DO NOT include
the single-quotes),
d) Click 'OK' and then close out of the 'File Types' dialogs. (You can
change the icon of the 'PS' type if you wish, we use the Ghostscript icon.)
e) If there is no 'PS' file type listed you will need to configure one:
1) On the 'Folder Options' dialog click the 'New'
button beneath the 'Registered file types' list box,
2) Type 'PS' in the 'File type' field and click
'OK',
3) Proceed with '5b' above.
The above steps will associate the '.PS' file type with our 'ps2pdf.bat' file
and add a 'Make PDF' entry on the Windows Explorer context menu list. You can
add other extensions, such as '.EPS' and '.PRN' as necessary.
Creating the PDF file:
With the preliminaries out of the way, it becomes a two-step process to
create the PDF file:
1) Plot the drawing to a file: In AutoCAD, call up the Plot dialog
as you normally would. Change the plotter configuration to the AutoCAD
PostScript plotter and verify the paper size settings. If you used the AutoCAD
HDI driver, the 'Plot-to-file' box should already be checked and the file name
extension correctly set as '.PS'. If you set up an AutoCAD plotter for a Windows
system printer you will need to manually set these. Now plot the drawing to
file,
2) Convert the PostScript file to a PDF document: In Windows
Explorer, browse to the PostScript file you created. You can perform the
conversion by either double-clicking on the file or highlighting it,
right-clicking, and selecting 'Make PDF' in the context menu. [Also see
MakePDF by ActiveDwg.com below.]
We have tried to cover the basics of creating PDF documents from your drawings
using a free and accessible method. Once configured, we hope it serves you well.
If you have any trouble, double-check your settings.
MakePDF:
MakePDF is a PDF creation helper utility by ActiveDwg.com.
The current version is 1.3.0 and it requires the Ghostscript and the VB6 runtimes.
You can download MakePDF here (32k).
After you agree to the AFPL license,
you can download gsdll32.zip here (1.4MB). Unzip it into the folder with MakePDF.exe.
1) Place MakePDF.exe in any folder you like, we suggest 'c:\gs\MakePDF',
2) Locate 'gsdll32.dll' and place it in the folder with MakePDF.exe. It is usually located in the Ghostscript '\bin' subfolder,
3) Create the PostScript file(s). See the 'Make PDF' article in the AutoCAD section at http://www.ActiveDwg.com,
4) Run MakePDF.exe to select the file(s) for conversion,
4a) MakePDF will accept standard PostScript files ('.PS') or encapsulated PostScript files ('.EPS'),
5) If you select multiple files you will be asked whether you want the files combined into a single PDF file,
5a) If you want the files combined, you will be prompted for the target name and location.
5b) MakePDF inserts bookmarks based on the selected file names in the combined PDF file.
Limitations in the current version:
a) Will NOT accept file names that include spaces.
ActiveDwg has tested MakePDF for our purposes.
You should test it thoroughly for your own purposes as ActiveDwg.com assumes no responsibilty,
and will accept no liability, for its use or functionality, for any particular purpose.
MakePDF is copyright (c) 2004-2007 by ActiveDwg.com