For an overview of the new AutoCAD® 2017 PDF Import feature, check out the first entry in Heidi Hewett’s “What’s New in AutoCAD 2017?” blog series: PDF Import.
My more-narrow focus here is to answer this question: Now that AutoCAD 2017-based products directly import data from PDF files, are there any practical limitations I need to know about in regards to converting PDF to DWG?
Answer: That depends on your intended use.
For example, if you’re simply importing catalog items, a schedule, or a landscape plan for visual reference, the answer is No, there are no practical limitations. You can stop reading right here. Enjoy the rest of your day.
On the other hand, if you require higher precision, plan to use object snaps and offsets, and will be duplicating objects imported from PDFs, you need to understand the limitations intrinsic to the imported data.
Let’s compare the differences in the data stored in a PDF with the data stored in a DWG™ file, and see how that affects your results.
Comparing PDF and DWG Formats
There’s a profound difference between PDF and DWG files in data content, format, and structure.
The data in PDF format supports the following:
- Real numbers that are usually represented with single-precision floating-point accuracy in recent versions
- Five graphical object types: path (line segments and Bézier curves), shading, TrueType™ text, inline image, and external
- Several properties that include primarily colors, layers, and line widths
However, the data in AutoCAD DWG format supports the following:
- Real numbers that are represented with double-precision floating-point accuracy, which is several orders of magnitude more precise than single precision
- More than 60 types of geometric objects, including compound objects such as dimensions, hatches, and blocks
- More than 50 types of properties
- Object associativity such as is available with hatches, blocks, and dimensions
As a result, the values for coordinates, angles, distances, and widths are rounded off. So objects will be modified slightly when you output geometric data to a PDF file. These differences are most noticeable when working with large distances and dynamic ranges, as is common with large maps.
Note: The accuracy that’s lost is difficult to restore without employing inferences. More about inferences later.
Behavioral losses include the following:
- Block references become geometric objects as if exploded
- Most non-continuous linetypes become separate collinear objects
- Hatch patterns become many individual objects without associativity
- Dimensions become individual lines, 2d solids, and mtext objects
- Text that uses SHX styles become geometric objects as if they were exploded with TXTEXP; however, TrueType text will maintain its fidelity when the same fonts are available
PDF automatically includes Courier-, Helvetica-, Times-, Symbol, and ZapfDingbats fonts. It will also use any TrueType fonts available on your computer, or it will use a substitute font with similar parameters.
Converting Data To and From PDF
To convert data to and from PDF requires direct translators that interpret and try to reconcile the data. These direct translators are included in each AutoCAD product and are usually called “drivers” depending on the context.
Note: PDF drivers, which are the responsibility of each company, can vary in capability and quality. These differences will affect PDF import or export operations between products. For example, dpi (dots-per-inch) output resolution can be set to different values in some products. In AutoCAD, you can specify a maximum of 4800 dpi. Using a lower output resolution decreases the PDF file size, but increases the round-off errors.
Understanding the Role of Inference
After the PDF data is imported, the biggest challenge is inference. This is a process by which AutoCAD starts with the equivalent of exploded data (what we affectionately call “grass clippings”) and makes some best guesses to reconstruct more precise locations, object types, and associations.
For example, the software might try to answer questions such as the following:
- Is this line supposed to be exactly horizontal?
- Should the length of this line be rounded to exactly 10.00000000?
- Should these two endpoints be made coincident?
- Should these four arc-shaped objects be combined into a circle, or are they closer to an ellipse or a closed spline?
- Are these objects part of a block?
- Are these objects part of a hatch object?
- Are these collinear line segments part of a non-continuous linetype?
- Is this geometry and text supposed to be an associative dimension object?
- Is this geometry a text object that was created with an SHX font?
- And so on….
Currently, AutoCAD supports the following inferences:
- Circles will be inferred from objects that closely approximate a circle
- Ellipses will be inferred if the elliptical geometry was represented in the PDF as a sequence of lines rather than Bézier curves
- B-splines will be inferred from Bézier curves
- Polylines can optionally be inferred from a contiguous series of lines and arcs
- Solid hatches can optionally be inferred from filled areas in the PDF
- Lines with a dashed linetype can optionally be inferred from a series of collinear lines that approximate a dashed line
The important concept? The inference process is imperfect, and will often require cleanup.
When it comes to PDF to DWG conversion, it’s best to think of PDF as a form of electronic plot output that’s great for visual reference, added hyperlinks, and limited transfer of information between different functional groups and audiences.
However, when you need to maintain precision, be careful about mixing data from different sources that do not maintain the same level of precision.
Conversely, some PDFs are generated with the dpi output deliberately set low or the objects are replaced with a raster image to provide a visual representation with low precision.
Understand the underlying limitations inherent in PDF and you can set reasonable expectations and get the maximum benefit from this exciting new capability.
This Just In….
The Autodesk Knowledge Network has recorded the following problem and fix: Error: Import PDF File–No Objects Imported
You can also check out: How to prevent stray dashed lines when importing PDF files into AutoCAD-based products