下面是vbscript脚本
Dim obj
Set obj= CreateObject("DWGTOPDFX.ConvertPDF")
obj.AddExcudeLayer "Defpoints" 'OffLayers
obj.Width = 250 'uint is mm
obj.Height = 150 'uint is mm
obj.ColorMode = 0 '1--white&black, 0--256 color mode
obj.InputFile = "Office.dwg"
obj.PenWidth(7) = 0.2 'set line width, unit in mm, color index (0) is black, (1) is red...etc
'obj.nBackgroundColor = 0 'default background color is white, 0-black 1-red...
'obj.PSPath = "c:\winnt\system32\ps" 'set postscript support files path. Please copy the PS files to the right location and add it here.
'obj.AddFontPath("C:\\Xref\\") 'Add font support path
'obj.AddFontPath "E:\Program Files\AutoCAD 2007\Fonts" 'Add font support path
MsgBox "Begin converting..."
obj.Convert "Office.pdf"
MsgBox "Conversion complete"
If Err.Number < 0 Then
MsgBox Err.Description
End If