想把一个DWG文件打印为PDF,图形都能正常打开,就最后一句的时候打印失败,请高手指点
Imports SystemImports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim AcadApp As Autodesk.AutoCAD.Interop.AcadApplication
Dim AcadDoc As Autodesk.AutoCAD.Interop.AcadDocument
AcadApp = CreateObject("autocad.application")
AcadApp.Visible = True
AcadApp.Documents.Open("C:\1.DWG")
AcadDoc = AcadApp.ActiveDocument
AcadDoc.ModelSpace.Layout.PlotType = Autodesk.AutoCAD.Interop.Common.AcPlotType.acExtents '定义打印范围
AcadDoc.ModelSpace.Layout.ConfigName = "DWG To PDF.pc3" '选定打印机配置
AcadDoc.ModelSpace.Layout.CanonicalMediaName = "ANSI_A_(11.00_x_8.50_Inches)" '设置图幅
AcadDoc.Plot.PlotToFile("C:\1.pdf") '打印
End Sub
http://bbs.mjtd.com/xwb/images/bgimg/icon_logo.png 该贴已经同步到 跃池先生的微博 前面不了解,只是提示下,如果是Win7,可能有权限限制,试试换个非系统目录。 mikewolf2k 发表于 2014-11-26 08:46 static/image/common/back.gif
前面不了解,只是提示下,如果是Win7,可能有权限限制,试试换个非系统目录。
还真是这个原因,换成D盘就可以了,非常感谢!!!
页:
[1]