With Teigha, you can export a .dwg file to a .pdf file that has PRC support.
The easiest way to see how it works is to use the OdaMfcApp sample application and the steps below.
1. Run OdaMfcApp.
2. Open a .dwg or .dxf file.
3. Choose File -> Export To Pdf.
4. In the Export To Pdf dialog box that opens, configure the export:
• Specify the output file name.
• Disable "Use hidden lines removal algorithm" because you cannot turn on PRC support mode and use the hidden lines removal algorithm (HLR) at the same time.
• Select "Enable PRC".
5. Click Export.
6. After the drawing is exported, you will have a .pdf file that contains the PRC stream.
By default (if "Export as BRep" is not selected), the drawing is exported as a mesh. If the option "Export as BRep" is selected, the drawing is exported as a BRep, if possible. You can compress BReps by selecting the required level of compression:
• Loose compression — Compression with 0.001 mm tolerance.
• Medium compression — Compression with 0.01 mm tolerance.
• High compression — Compression with 0.1 mm tolerance.
If the option "Enable single view mode" is selected, all the entities located in one view of a drawing database will be exported into a PRC stream of the output .pdf file. All entities will be located in one view.
In the pictures above, on the right is the exported result using the "Enable single view mode" option; on the left is the exported result without using the option. In the case on the left, each entity is located in an individual view. Views can overlap each other, as shown in the picture.
For more details, see Teigha_documentation (login required).