Jump to content

How to Translate PDF SHX Into Mtext


Recommended Posts

The AutoCAD Blog
Posted

In a recent article, I discussed the power of importing vector-based PDF files into AutoCAD. However, there can be one minor challenge.

TrueType fonts import fine, but SHX fonts do not—they come in as individual polyline segments. If you find yourself in this situation, you’ll need to perform a secondary step to turn the “visual fidelity” version into a real font.

TrueType AutoCAD font

The tools you’ll need can be found nestled snugly next to the PDF Import command. You can start with either, as you can get to the Settings from the Recognize command as well.

AutoCAD PDF import

We’ll start with the recognition command, also available from the command line as PDFSHXTEXT. You’ll be prompted to Select Objects, but you can also call up the Settings Dialog from either the Command Line, the Dynamic Input tool, or from the right click Popup Menu.

PDF SHX AutoCAD

PDF Text Recognition Settings Dialog Box

The PDF Text Recognition Settings dialog box looks busy, but it’s really not. The most important thing about it is the “SHX fonts to compare” panel in the upper left. Now, if you know for sure what font you’re searching to find, your job just got easier. For example, maybe it’s a drawing from your office that uses your company standard of Simplex. Tick Simplex only in this section.

If you’re unsure what font was used or maybe there’s a mixture, select those that you want to compare. Finally, if you have no idea what you’re searching for, you can tick the “Use best matching font” box, and the program will do just that.

You may note the that the light bulb info is telling you that this is the most important part of the settings. If the font you’re looking for is not in the box, just use the Add button. Also, the order is important. In this example, the tool will first search for Simplex, then Romans, Txt, and finally Isocp. There are buttons on the right side of the compare panel to allow you to reorder the list.

Also, there is a slider to adjust the Recognition Threshold, but I suggest leaving it at its default of 95 for best performance. As usual, your mileage may vary, so if you need to throttle it back, feel free.

Finally, there is a preview box, which will let you see what the highlighted font in the compare box looks like. You may want to type in some example text from your drawing to see how it compares.

Text Recognition Settings AutoCAD

Now that you have the recognition settings made, click OK to dismiss the dialog, and you can proceed to selecting your text. If you take nothing else from this post, please remember this: avoid the temptation to zoom extents and dragging a crossing selection box across the whole drawing. You won’t like the results.

Instead, zoom into an area and select smaller groups of “text.” In a way, this tool is a lot like you, in that it’s easier for you to recognize a font if you’re zoomed in and can see it in detail, as opposed to seeing as a spot of colored pixels from far away. Yes, it will make the process more tedious, but you’ll quickly develop a workflow, and in the end, you’ll get better results.

So, once you select your objects and hit Enter, the tool will do its comparison and translation, then prompt you with some information about what it did. Please take the time to read it. If it failed on something, you’ll need to know, and as I’ve said, you can’t always tell if what you’re looking at is front a font, or a bunch of polylines masquerading as text.

In our simple example we see that 1 of 1 groups were converted to Mtext by using Simplex.

SHX MText AutoCAD

A Little More to Think About

More than likely, you’ll find yourself needing to convert the newly translated single lines of Mtext into a single Mtext object.

For this, you’ll use the other tool found in the Import panel called Combine Text.

AutoCAD combine text

Simply select the individual lines, and this tool will convert it into one Mtext object.

SHX to Mtext AutoCAD

Final Thoughts

Hopefully this article and the previous article on how to import a PDF has made you consider using PDF Import the next time you need to turn a vector-based PDF into AutoCAD geometry. If you do, and if you’re on team SHX, now you know how to handle the polyline representations it creates.

With so many variables from within a PDF, sometimes the results aren’t perfect. But if you understand the limitations going in, your eventual outcome will be better. In any case, it’s much better than re-creating an entire drawing on top of a PDF Underlay.

The post How to Translate PDF SHX Into Mtext appeared first on AutoCAD Blog.

xBAfiPcT-hY

View the full article

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...