AutoCAD Searchable Text in PDF Files
By John TeSelle, LineType Software Inc., July 10, 2003
When a PDF file is opened for viewing in Acrobat or Acrobat Reader, it may be searched for occurrences of a word or phrase. By extending this functionality to PDFs generated from CAD drawings, it is possible to search a single sheet or an entire project for specific terms or material designations.
In order for this feature to work, however, text must be written to the PDF file as text rather than as geometric shapes. AutoCAD supports two different types of fonts: SHX fonts (an older format that is AutoCAD-specific) and TrueType or TTF fonts which are available to all Windows applications. TrueType fonts may be written to the PDF as either graphics (not searchable) or text (searchable). SHX fonts are almost always written to PDF files as geometric shapes, and therefore their interpretation as text is lost.
There are two PDF-creation utilities that are able to convert SHX fonts to searchable text -- the Layton Graphics CAD2PDF application, and Acrobat 6 Professional, which includes an AutoCAD to PDF converter. Evaluate these carefully, though -- the location of searched-for text sometimes does not display correctly in Acrobat when it is created from SHX fonts. This article addresses the more commonly-accessible method of using TrueType fonts to create searchable text.
Some PDF printer drivers do not support creation of searchable text, even with TrueType fonts. See the PDF Creation page for more information.
The following describes the AutoCAD settings necessary to create searchable PDFs from TrueType font text:
First, make sure that the text you want to be searchable is defined with a TrueType font. In AutoCAD, every text object has a text style associated with it. The style, in turn, has a font associated with it, and the font may be either SHX or TrueType. Check the AutoCAD documentation for more information about changing fonts and text styles.
For each text style, the following variables must be set as indicated:
Oblique angle = 0
Width factor = 1
Obliquing = 0
Width factor = 1
Text alignment Z = 0
Position Z = 0
Upside down = No
Backward = No
Text rotated with the ROTATE command is ok. Mirrored text is not.
Text in XREFs or blocks will only be written as text if the XREF or block has a scale factor of 1. If the XREF or block has been scaled with the SCALE command, then text will be written as graphics.
As indicated in the text object settings, only text objects that have a Z coordinate of zero will be converted as searchable text.
Set the system variable TEXTFILL = 1.
If the HIDEPLOT feature is being used in Paperspace layouts, it must be turned off.
In the Plot dialog box, choose Properties next to the PDF printer driver name. Under the Device and Document Settings tab, open the Graphics list and choose True Type Text. Set this property to TrueType as text and close all dialog boxes.
Searching for Text
After the PDF file has been generated, use the Find command in Acrobat or Acrobat Reader to search for specific words or phrases.
Note: Sometimes the check box "Find backwards" must be checked, and sometimes unchecked, to search for text. Try it both ways to be sure.
Using Acrobat Indexes
The full version of Acrobat includes a indexed search feature that allows creation of an external search index for a library of PDF files. The search index is created once by scanning all PDF files in the library, and it can then be used to search for a word or phrase in any files in that library without having to open up each file individually.
For more information on the use of indexes, see the Adobe Acrobat documentation.
About the Author
John TeSelle is an architect in private practice in Nashville, Tennessee, and is the founder of LineType Software Inc., a development company providing tools and information to enhance the use of PDF documents in architecture and engineering.