将 dwg 文件转换为 pdf [英] Convert dwg file to pdf
问题描述
我刚接触 AutoCAD,并被要求编写一个 C# 实用程序,可以将 .dwg 文件转换为 pdf.我一直在谷歌搜索,还没有想出任何办法.你有什么建议吗?
I'm quite new to AutoCAD and has been asked to write a C# utility that can convert a .dwg file to pdf. I've been googling around and haven't figured out any way yet. Do you have any suggestion?
推荐答案
如果您正在自动化 AutoCAD,那么只需发送一个命令即可使用 DWG to PDF.pc3
打印机绘制适当的布局.如果您使用的是 COM,您正在寻找 SendStringToExecute()
或 SendCommand()
.
If you are automating AutoCAD then just simply send a command to plot the appropriate layout using the DWG to PDF.pc3
printer. You're looking for SendStringToExecute()
or SendCommand()
if you are using COM.
C# 对此有些过分,即使您是批量绘图,AutoCAD 也为此内置了命令.请参见 AutoCAD Publish
命令.
C# is overkill for this, even if you are batch-plotting thee are commands built into AutoCAD for this. See the AutoCAD Publish
command.
编辑以回应下面的评论.您应该查看 https://developer.autodesk.com/api/autocadio/ - 它是AutoCAD 作为 Web 服务.
Edit in response to comment below. You should look at https://developer.autodesk.com/api/autocadio/ - it's AutoCAD as a web service.
这篇关于将 dwg 文件转换为 pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!