Wednesday, January 9, 2013

Postscript and PDF Conversions 101

Convert any PDF (or Postscript) to Gerber, GDSII, NC, and more!

Learn how to accurately convert your PDF files (and Postscript) to various EDA/manufacturing formats no one thought was possible.  You now have the freedom to use any graphics software tool (like Adobe Illustrator) to layout unique electronic designs, save them as a PDF (or Postscript), and have our tools ACE 3000 or FAB 3000 accurately convert them to Gerber, GDSII, NC, and more; compatible with any PCB Fabricator or Mask shop.  Also, provides an excellent documentation solution for PCB manufacturers who prefer Fab Drawings in Gerber format instead of PDF (simply convert the PDF drawings to Gerber).
To get started, please perform the following 4 Steps:

STEP 1:  Get your Free Trial of FAB 3000 or ACE 3000.

It's easy. If you haven't purchase FAB 3000 or ACE 3000 yet, get your free trial by clicking the link below and filling out the form:
ACE Translator 3000 V7 - FREE TRIAL

STEP 2:  Ghostscript Setup

One of the key components to making Postscript & PDF import work is Ghostscript, an excellent & freely available Postscript interpreter. Our software relies on Ghostscript to read and handle all vector objects such as text, lines, polygons, circles, arcs, splines, and more; however it will not process embedded raster images. Due to the nature of the Ghostscript GPL license, it must be installed separately by the end-user.  Requiring the user to separately install Ghostscript does pose a potential problem, so we've created quick instructions to help you get Ghostscript installed correctly.
1.  There are many, many versions of Ghostscript which can be downloaded and it's updated about every month or two. 
2.  Some installations contain "source code only", some are linux binaries, some are Windows binaries, some are 32-bit binaries and some are 64-bit.
3.  Some versions of Ghostscript produce better results than others (especially for text). For example, if you're getting undesired results for the text (such as wrong font used, or it looks extremely weird), then we strongly encourage you to use a different version of Ghostscript during import; as each major version of Ghostscript seems to handle fonts differently.
So which version of Ghostscript should you choose?
Luckily both FAB and ACE can handle multiple versions of Ghostscript simultaneously during import, so the answer is ALL 3 major releases of Ghostscript:

Ghostscript Version 7
Ghostscript Version 8
Ghostscript Version 9
Note: Click each link above and install all three major versions (if possible).

STEP 3:  Choosing the Best Ghostscript Version to Use during Postscript & PDF import.

Our software easily detects all installations of Ghostscript on your local computer, and lets you choose which version you wish to use during import. Typically all versions of Ghostscript will produce the same results, except for the following:
Text: If you're getting undesired results for the text (such as wrong font used, or it looks extremely weird), then we strongly encourage you use a different version of Ghostscript.  Each major version of Ghostscript handles fonts differently.
 PDF Import: While Ghostscript version 7 works wonderfully for Postscript, it's ability to open many modern PDF files leaves a little to be desired.  If you need to import PDF files, then we recommend a much more updated Ghostscript version such as 8 or newer.  It's okay to have more than one version of Ghostscript on your computer, and many advanced users will instruct our software to use a specific version of Ghostscript when importing Postscript and a different version when importing PDF files.
Helpful Tip: Postscript > PDF.  Postscript files are the preferred file format (over PDF) for converting artworks that require high accuracy. Why? Many well known PDF distillers and other PDF generation tools typically output PDF's with limited resolutions.
We recommend starting with the latest Ghostscript Version 9, and only move down if you're having problems. To choose the Ghostscript version to use during import select the available Ghostscript installations from the pull-down control (see below for a screen capture in ACE 3000):

 STEP 4:  Understanding the Postscript/PDF Import Options

Page Number to convert:  Our tools can only import one page at a time, so if your Postscript or PDF file has more than one page, you may choose which page to import. The default is Page 1.
Spline/Arc Precision: The maximum error allowed when computing points on curve. This feature allows designs with large and small curves to equally maintain high-resolution and quality. The smaller the Spline Deviation the more accurate your final curves will become - however exported file sizes may become larger.
Ghostscript Commands (Optional): Request additional commands that will be sent directly to the GhostScript interpreter.
Map Layers/Colors: Determine how to associate postscript objects to a layer.
Merge All to a Single Layer: Place all postscript objects onto a single layer.
Separate Layer per each Color: This setting creates a new layer for each object color in the postscript file.
Convert Paths To: Determine how to process Path objects.
Auto-Detect: Use the same path types found in the Postscript/PDF.
Polygon: Output all paths as polygons.
Rounded: Force all paths to be rounded. Sometimes when using Postscript/PDF's for artwork you'll discover that the path quality is not very good (especially for PCB's), so a rounded path produces better results.
Truncate: Output all paths as truncated paths (square path with no end cap).
Extended: Output all paths as extended paths (square path with 1/2 width end cap).
Fill Mode: Determine how to fill objects.
Auto-Detect: In most Postscript drawings objects drawn with a "white" color represent a hole (or transparency). This setting will De-Embed all postscript objects that are the color "white" from all remaining objects.
De-Embed: Use built-in De-Embed Algorithm to determine what is transparent.
Fill All: Fill all objects and ignore transparency.
No Fill: When possible, do not fill any objects.
Text Output: Determine how to process Text objects.
None: Ignore Text
Polygon: Output Text as Polygons (default).
Polygon Adjustable: Output Text as Polygons with Adjustable spacing.
Use Default Font: Substitute Postscript font with an ACE font. This may be necessary when the font quality from Ghostscript is poor.
Default Font: ACE/FAB 3000 font to use when Text Output is set to "Use Default Font".
Flash Round/Donut Shapes: This option will detect circles & donut shapes and convert them to gerber flashes. Very useful when exporting to Gerber
Flash Rectangle Shapes: This option will detect square & rectangular shapes and convert them to gerber flashes. Very useful when exporting to Gerber
Select Ghostscript DLL/EXE: To import Postscript / PDF requires that Ghostscript is installed. You can choose which Ghostscript version to use during import, and you may also use the file selector '...' to manually assign a specific version of Ghostscript.

TUTORIAL MOVIE:  See Postscript/PDF Import in Action

Using ACE 3000 to import Postscript using Ghostscript 7 which provides bad Text, so repeat using Ghostscript 9. See how easy it is to choose which Ghostscript Version to use.

Using FAB 3000, import a PDF file of Fab Drawing and export to Gerber:

It's very common for us to receive a support email or message...
I want to import a Postscript/PDF file into ACE 3000, it gets to 15% and then says:
FATAL: Unable to parse Postscript/PDF file:
FATAL: Verify if the Ghostscript interpreter is installed correctly.
FATAL: Translation Failed.

Can you please help me?

1. Make sure you have the latest version of our software tools. 
Why?  We're continuously improving our software and have made many improvements on how it finds and links to Ghostscript.  Chances are if you're using an older version pre-November 2012, it may be the problem.

2. Make sure you tell our software where to find Ghostscript.
Why?  Typically our software will first search the System Registry for the Ghostscript DLL, however many systems & installations are setup different; so relying on our tools to find Ghostscript can cause inconsistencies.  Your best bet (before performing the Postscript/PDF Import), is to start our software and assign the Ghostscript DLL location:
3.  Make sure you have installed the 32-bit version of Ghostscript and not the 64-bit Ghostscript. 
Why? Even though you may have a 64-bit computer, our software uses the 32-bit version of Ghostscript.  Thus the 64-bit version of Ghostscript will not work.

4.  Try selecting the Ghostscript command-line executable instead of the DLL. 
Why?  Our software can handle both the DLL and EXE version of Ghostscript.  In some cases, the EXE works better than the DLL.  Go to the menu:  Setup | Options...   Go to the tab "Misc." and enter the location of the "Ghostscript DLL".
ex.  C:\gs\gs7.05\bin\gsdll32.exe

5. Try using of Environment Variable "PS". 
Why?  When our software still cannot find Ghostscript, it will search for the environment variable:  PS   All you do is go to the Windows System Settings, press button Advanced and add the "Environment Variable". 

Note:  Don't forget you need to restart your computer for the system variable to take effect.

Note:  Both FAB 3000 and ACE 3000 will work with just about any version of Ghostscript, however we have spent the most time testing 7.05, 8.53, and the new version 9.

DXF Conversion Secrets for Gerber, GDS-II, ODB++, etc.

By Simon Garrison, Applications Manager - Numerical Innovations

It is estimated over 10%-15% of all electronic layouts (for PCB's, RF, IC/MEMs, etc) are still designed using Mechanical CAD tools (like AutoCAD, SolidWorks, ProE, etc). Why?

The power of MCAD tools (like AutoCAD) are that they support a wide array of entities types which can be used to easily construct electronic designs from the simplest PCB to the most complex IC/MEMs circuit.  Designers generally choose to layout their designs in MCAD when existing EDA/Layout tools do not possess the capabilities to meet unique geometrical requirements.  Once the layout is completed and a DXF file is outputted; they will attempt to convert to a manufacturing format (such as Gerber data, GDS-II, ODB++, NC, etc.)  – seems simple enough right? Wrong! This approach usually results in an astonished look on the designers face, when they view their converted manufacturing files and discover those files are not worthy of sending out for fabrication... Why?

This has been a mystery which has plagued designers and mask makers for well over 20 years, and the purpose of this article is to help explain common problems and how to solve them.
FACT: Most Fabricators & Mask shops won’t touch your DXF data with a 10 foot pole and ask that you provide them only with the manufacturing formats (such as Gerber data, GDS-II, ODB++, NC, etc.) – which is probably why you are reading this article in the first place :)

1. Understand the file format basics:

DXF/DWG Format :
DXF stands for Drawing Exchange Format, and it is a format for transferring drawings between Computer Aided Design systems. DXF is widely used as the de facto standard in the engineering and construction industries. The DXF format is a tagged data representation of all the information contained in an AutoCAD® drawing file. Tagged data means that each data element in the file is preceded by an integer number that is called a group code. A group code's value indicates what type of data element follows. This value also indicates the meaning of a data element for a given object (or record) type. Virtually all user-specified information in a drawing file can be represented in DXF format. DWG is essentially a binary version of DXF which tends to be smaller and cause less parsing errors during conversions.
Gerber Format :
To figure out the problems and how to overcome them, first lets look that the format you want to convert your AutoCAD drawing to: Gerber. The Gerber format is well over 35 years old and is simply an ASCII text file containing X,Y coordinates, and shapes (i.e apertures/dcodes). For more information about Gerber, visit the following link:
GDS-II Format:
GDSII is a binary file format created in the 1970's which is classified as a "data interchange format", used for transferring mask-design data between the IC designer and the fabrication facility.  GDS-II can only support simple physical objects such as Polygons, Paths, Rectangles, and Instances (for hierarchy). FACT: Unlike the older Gerber and GDSII formats, every year you can expect there’s going to be a new release of AutoCAD and with each release there are usually changes to the entity types, DXF format, which continuously pose compatibility issues and other problems.
ODB++ Format:
ODB++ is the most intelligent PCB data exchange format available today, capturing all CAD/EDA, assembly and PCB fabrication knowledge in one single, unified database. Originally developed by Valor Computerized Systems for use in its own PCB CAD/CAM systems, Genesis 2000, Enterprise 3000 and Trilogy , ODB++ has already become widely accepted as the de facto industry standard, providing unprecedented power to PCB design, fabrication and assembly, with the flexibility to expand as required. In parallel, ODB++ is providing most of the technological basis for the new IPC2581 standard for data exchange in the PCB fabrication and assembly industry.

2. When possible, keep your Drawings simple (Using 5 Fundamental Entities)

The easiest way to convert DXF to manufacturing formats (such as Gerber data, GDS-II, ODB++, NC) is to keep things simple. DXF files support hundreds of various entity types (like Hatches, Blocks/Inserts, 3D objects, Tapered Polylines, TrueType fonts & Multiline-text, Splines, Regions, plus Model/Paper Space considerations, and much more), so the question remains how do we convert those fancy entity types into simple manufacturing formats which only contains X,Y coordinates, and shapes – Simple, for best results create your layouts using the 5 fundamental DXF entities that will lead to successful conversions.
What are the 5 fundamental DXF entities?
Polylines (or LW Polylines), Circles, Text, Blocks, Inserts. Believe or not, you can create just about any PCB/RF layout using only these 5 entities, and they most closely represent objects in Manufacturing data.
Polylines (or LW Polylines): A series of connected lines and arcs than may have varying widths. This is the most common entity used to construct a PCB/RF layout and is used in about 80% of the layout. Polylines with width are used to draw traces (i.e. tracks) to connect pads. Polylines with 0-width are commonly used to create filled boundaries. Polylines may also be used to created square and donut pads.

Circles: Most commonly used to draw round pads.
Text: Used to draw silkscreen and labels. Typically using stick fonts which are AutoCAD compiled fonts (SHX) provide the best results, and are output as trace segments in manufacturing data. TrueType fonts are acceptable provided your conversion tool can output them as simple polygons.
Blocks / Inserts: Typically used to create a hierarchy in your design, and provide an optimized method to add repeated entities into your drawing. Blocks are essentially individual drawings that are inserted into a parent drawing. During the insertion, blocks can be rotated, scaled, and transformed in any direction. Blocks can be inserted multiple times as and array using Minsert (Multiple Inserts) which allows an array of blocks either rectangular or polar.

3. Understand how to Fill Boundaries generated from MCAD

A filled boundary in manufacturing formats (such as Gerber, GDS-II, ODB++) typically represents areas where metal will be present. Most MCAD tools (like AutoCAD) do not support filled boundaries and instead only display object outlines or wire-frame. 
FACT: The most common reason Designers have problems when converting their DXF to manufacturing formats (such as Gerber, GDS-II, ODB++) is directly tied to the fact MCAD tools typically do not display filled boundaries correctly -- thus a Designer must visualize how their layout will be filled -- even though their MCAD tools is displaying outlines & wire-frames only.

How do I create a filled area in my Manufacturing data?
To create a filled area, first draw a closed, continuous boundary (with 0-width polyline) that does not self-intersect. Remember manufacturing formats (such as Gerber, GDS-II, ODB++) have stringent fill rules: All boundaries must be continuous, with no overlapping or self-intersections (like a bow-tie). The direction is typically not significant for filled boundaries (i.e clockwise or counter-clockwise).
Using JOIN:  The Boundaries in my Manufacturing data are still not filled, why?
Most likely your boundaries are not closed & continuous (as described above). In many cases you may have a drawing which consists of individual line and arc segments – which are not continuous. We recommend that you convert those boundaries to Closed, 0-width polylines using the command “Pedit” and then select “Join”.  We offer two conversion tools: FAB 3000 and ACE 3000 which have built in join tools that instantly connect all adjacent lines/arcs and convert them to closed boundaries.  See movie tutorial "FAB 3000: Using Join and DeEmbed"

4. Understand COMPOSITE Fill. Determine what areas should be Dark or Clear (i.e. Island).

To understand composites, we first recommend checking out an article from the ACE 3000 help manual called Composites 101

Depending on the manufacturing format you're outputting to composites will be handled different.
Gerber / ODB++ Format: In the Gerber and ODB++ format, there is no such thing as island/hole detection. Fortunately both formats directly support Composites which allow you to explicitly define what to make clear or dark using the gerber commands “LPD” (Layer Polarity Dark) and “LPC” (Layer Polarity Clear). The most reliable way to define a composite, is to create separate DXF layers for each polarity change. For example: If you require a dark rectangular boundary with many clear holes, you should create two layers:
One layer which contains only the rectangular boundary, and a second layer which only contains the holes. During DXF conversion you can create a composite gerber merge and assign the polarity for each layer.
GDS-II Format: GDS-II doesn't support Composites (Dark/Clear), it only supports simple Polygons/Rects/Paths, so you must use a boolean engine to add "cutlines" that connect inner holes with outer boundaries.
What is Polygon De-Embedding?

Some conversion tools will have a featured called “Polygon De-Embedding”, where the conversion tool will decipher which objects are contained inside of other objects and logically try to determine what should be an island or hole and then explicitly output that information to the manufacturing format file.
Should I use Solid Hatch to composite fill an area?
Solid hatches look good in AutoCAD because they are the one of few entities in AutoCAD that appeared filled (on the AutoCAD screen). But remember a solid hatch is drawn on top of your existing drawing, causing duplicate data in the DXF, and results from a Gerber conversion can be messy because of the duplicate objects. If you must use solid hatches, please make sure your conversion software supports solid hatching and has the ability to detect islands/holes when necessary.

Tutorial Demonstrations using ACE 3000, FAB 3000, and EasyGerb

 Using ACE Translator 3000 to convert DXF to Gerber, GDSII, and more.

DXF to Gerber, GDSII, and more. Converting DXF to Gerber (for a microwave coil)

Using FAB 3000 to convert DXF

Easily Convert DXF to Gerber
FAB 3000: Import DXF, use join and export to gerber

Use EasyGerb to output Gerber files, while directly inside AutoCAD

Using EasyGerb 5 Inside AutoCAD to export Gerber files. Generate Composite Layers using EasyGerb

Checkout the User Forum for more assistance and answers to frequently asked questions about DXF conversions and more.

 ACE Translator Forum:

FAB 3000 Forum:
EasyGerb Forum:

Have more questions? Feel free to contact us directly: