Re: Export DWG to PDF

#2
Please refer the little snip code:

Code: Select all

Private Sub PlotToPdf()
    Dim Layout As Layout
    Set Layout = ActiveDocument.ActiveLayout
    Layout.RefreshPlotDeviceInfo
    Layout.ConfigName = "Microsoft Print to PDF"    ' PLOTTER
    Layout.PlotType = vicWindow
    Layout.PlotRotation = 0
    Layout.StyleSheet = "icad.ctb"
'    Layout.PlotWithPlotStyles = True
'    Layout.PlotViewportBorders = False
'    Layout.PlotViewportsFirst = True
    Layout.CanonicalMediaName = "A4"     ' SIZE
'    Layout.PaperUnits = vicInches
'    Layout.StandardScale = vic1_16i    ' SCALE
'    Layout.ShowPlotStyles = False
'    Layout.CenterPlot = True
'    Layout.ScaleLineweights = False
    Layout.RefreshPlotDeviceInfo

    IntelliCAD.PlotManager.SetWindow 0, 0, 10, 10
    
    ActiveDocument.PrintDrawing

End Sub
cron