Muhimbi’s range of server based PDF Conversion products has had the ability to convert AutoCAD (DXF and DWG) files for quite some time. It works really well, but as it doesn’t rely on AutoCAD being present it uses custom code to carry out the conversion. As the AutoCAD format is constantly evolving, certain features are not supported (e.g. 3D solids, bitmaps or embedded OLE objects).
The AutoCAD converter that comes with our software is improved all the time, however if you need a certain unsupported feature right now, and cannot wait, then you may want to consider adding a third party AutoCAD plug-in to your copy of the Muhimbi PDF Converter as described below. As a result you will be able to achieve perfect conversion fidelity when converting DXF and DWG files from your Java, PHP, Ruby, .NET or SharePoint solution.
The easiest way to add third party plug-ins to the Muhimbi PDF Converter is to make use of our generic Command Line Converter, which allows any third party product that can be controlled via the command line to be fully integrated with the PDF Converter, in a completely transparent manner, without losing any of the PDF Converter’s other features such as watermarking, merging and encryption.
Some of our existing customers already use this approach using either VisConvert (part of Siemens Teamcenter) or an affordable third party utility named Any DWG to PDF Converter (US$ 150 per server, contact us for a discount code). A Google search reveals other command line based DWG to PDF converters, but a quick evaluation reveals that the quality of many of those is questionable at best. At the bottom of this post you will find an alternative that some of our customers are using.
In the example below we’ll show how to integrate AnyDWG into the Muhimbi PDF Converter.
- Download and install the Muhimbi PDF Converter API & Server Platform or Muhimbi PDF Converter for SharePoint. During installation please pay close attention to Chapter 2 of the included Installation and Administrating Guide.
- Download and install Any DWG to PDF Converter Pro. In this example we assume it is installed in the default location.
- Open Muhimbi.DocumentConverter.Service.exe.config in your favourite text editor (notepad works as well). A handy shortcut to the configuration / installation folder that holds this config file can be found in the Muhimbi Document Converter Windows Start Menu group.
- Search for “CAD based formats” and remove or comment out the entire XML element.
- Search for “CommandLineConverter” and replace it with the following, don’t forget to remove the XML comments
- Save the configuration file.
- If you have any custom SHX fonts then please place these in the Fonts folder under the AnyDWG installation directory. On our test system that folder is located at
C:\Program Files (x86)\Any DWG to PDF Converter Pro\Fonts.
- Restart the Muhimbi Document Converter Service using the Services Management Console or using the command prompt:
- Validate the converters as described here and check that CAD Converter (CL) validates.
For more details about configuring 3rd party converters see this blog post.
Although AnyDWG integrates seamlessly with the Muhimbi PDF Converter, any CAD settings in our config file or Web Services based Object Model are ignored. Fear not as in case of AnyDWG most of the options can be added to the command line.
Listed below is an abstract of the AnyDWG help file that deals with command line options:
Hide the result window and the message dialog (Always specify this switch)
PDF width in millimeters, e.g.
PDF height in millimeters, e.g.
Disable the "Automatically adjust the page size based on the drawing" option
Margin in millimeters, e.g.
Output color, available values:
PDF quality, available values: Normal, Medium, High, Highest. e.g.
Output mode option, available values:
Output layout, available values:
Output area, available values:
Line width, available values:
Set the line width scale, e.g.
Set the PDF author, e.g.
Set the PDF title, e.g.
Set the PDF subject, e.g.
Set the PDF keywords, e.g.
Disable the "Create PDF bookmark" option
Disable the "Fill TTF font in the drawing" option
Disable the "Export Image/Excel file in the drawing" option
AnyDWG is far from the only command line CAD converter out there, it is simply one that we have experience with. Due to the complexity of DWG/DWF files, different converters will work differently depending on what has been included in the file (embedded objects, 2D/3D views, etc) and what you want the PDF to include. If AnyDWG does not meet you specific conversion needs, another third party product that may help is the Acme CAD Converter from DWG Tool Software.
The setup steps are the same as for AnyDWG, except for the installation details for the third party converter and the specifics of the command line. There are a number of command line switches, but in this example we use the default options that will create a basic conversion:
Invoke the command line and not GUI conversion
Fit conversion to the page
Specify conversion to PDF
Specify PDF output name and location
Any questions? Leave a comment below or contact us.