Coclass: ConvertPDF


Interface IConvertPDF

IConvertPDF members

Properties

Name | Type | HelpString | Category | Frequency of use
AddFontPath | Method | method AddFontPath | General | Normal
ColorMode | Property Let | property ColorMode | General | Normal
Convert | Method | method Convert | General | Normal
ConvertView | Method | method ConvertView | General | Normal
DPI | Property Let | property DPI | General | Normal
Height | Property Let | property Height | General | Normal
InputFile | Property Let | property InputFile | General | Normal
PenWidth | Property Get/Let | property PenWidth | General | Normal
PsPath | Property Let | property PsPath | General | Normal
ViewCount | Property Get | property ViewCount | General | Normal
ViewName | Property Get | property ViewName | General | Normal
Width | Property Let | property Width | General | Normal

IConvertPDF overview


Interface IConvertPDF

IConvertPDF members by category

Properties

Name | Type | HelpString | Category | Frequency of use
AddFontPath | Method | method AddFontPath | General | Normal
ColorMode | Property Let | property ColorMode | General | Normal
Convert | Method | method Convert | General | Normal
ConvertView | Method | method ConvertView | General | Normal
DPI | Property Let | property DPI | General | Normal
Height | Property Let | property Height | General | Normal
InputFile | Property Let | property InputFile | General | Normal
PenWidth | Property Get/Let | property PenWidth | General | Normal
PsPath | Property Let | property PsPath | General | Normal
ViewCount | Property Get | property ViewCount | General | Normal
ViewName | Property Get | property ViewName | General | Normal
Width | Property Let | property Width | General | Normal

IConvertPDF overview


Interface IConvertPDF

IConvertPDF members by frequency of use

Properties

Name | Type | HelpString | Category | Frequency of use
AddFontPath | Method | method AddFontPath | General | Normal
ColorMode | Property Let | property ColorMode | General | Normal
Convert | Method | method Convert | General | Normal
ConvertView | Method | method ConvertView | General | Normal
DPI | Property Let | property DPI | General | Normal
Height | Property Let | property Height | General | Normal
InputFile | Property Let | property InputFile | General | Normal
PenWidth | Property Get/Let | property PenWidth | General | Normal
PsPath | Property Let | property PsPath | General | Normal
ViewCount | Property Get | property ViewCount | General | Normal
ViewName | Property Get | property ViewName | General | Normal
Width | Property Let | property Width | General | Normal

IConvertPDF overview


IConvertPDF::AddFontPath

method AddFontPath

Add a directory to the folder list in which DWG2PDFX searches for shx font file.

Sub AddFontPath(szFontPath As String)

Parameters

No | Name | Type | Optional | Default | Description
1 | szFontPath | String | No | - | specifing the shx font directory

for example vb script:

Dim obj
Set obj= CreateObject("DWGTOPDFX.ConvertPDF")

obj.Width = 250 'uint is mm
obj.Height = 150 'uint is mm
obj.ColorMode = 1 '1--white&black 0--256color mode

obj.AddFontPath "D:\Program
Files\AutoCAD 2005\Fonts"

obj.InputFile = "E:\tempaa\44650-39b.dwg"
obj.PenWidth(1) = .1 'set line width, unit in mm
obj.PenWidth(2) = .1 'set line width, unit in mm
obj.PenWidth(3) = .1 'set line width, unit in mm
obj.PenWidth(4) = .1 'set line width, unit in mm
obj.PenWidth(5) = .1 'set line width, unit in mm
obj.PsPath = "c:\winnt\system32\ps"
obj.Convert "E:\tempaa\44650-39b1.pdf"

(C) 1999-2001 My Company All rights reserved


IConvertPDF::ColorMode

property ColorMode

Set the background color of the PDF file.

Property Let ColorMode As Long

No parameters

Set Colormode Value as AutoCAD colorindex.

for example

0 black

1 red

2 yellow

...

255 white


IConvertPDF::Convert

method Convert

Convert the drawing merge all layout into a single PDF file.

Sub Convert(szoutFile As String)

Parameters

No | Name | Type | Optional | Default | Description
1 | szoutFile | String | No | - | specifing the output PDF file name

use Convert after the method InputFile


IConvertPDF::ConvertView

method ConvertView

Convert specified layout in the drawing to PDF file.

Sub ConvertView(szOutputFileName As String, view)

Parameters

No | Name | Type | Optional | Default | Description
1 | szOutputFileName | String | No | - | specifing the output PDF file name
2 | view | Variant | No | - | specifing layout name as string specifing layout index as long

use convertView after the method InputFile


IConvertPDF::DPI

property DPI

Set PDF DPI (dots per inch ) value, the default value is 100.

Property Let DPI As Long

No parameters

for example vb script:

Dim obj
Set obj= CreateObject("DWGTOPDFX.ConvertPDF")

obj.Width = 250 'uint is mm
obj.Height = 150 'uint is mm
obj.ColorMode = 1 '1--white&black 0--256color mode

Obj.DPI = 300

obj.AddFontPath "D:\Program Files\AutoCAD 2005\Fonts"
obj.InputFile = "E:\tempaa\44650-39b.dwg"
obj.PsPath = "c:\winnt\system32\ps"
obj.Convert "E:\tempaa\44650-39b1.pdf"


IConvertPDF::Height

property Height

specifing the output PDF file Height , unit is millimeter.

Property Let Height As Double

No parameters


IConvertPDF::InputFile

property InputFile

specifing the input drawing file that want to be conveted.

Property Let InputFile As String

No parameters


IConvertPDF::PenWidth

property PenWidth

specifing the pen width of the color, unit is millimetre.

Property Get/Let PenWidth(nPenWidth As Long) As Double

Parameters

No | Name | Type | Optional | Default | Description
1 | nPenWidth | Long | No | 0.02 | the color index want to set pen width

for example vb script:

Dim obj
Set obj= CreateObject("DWGTOPDFX.ConvertPDF")

obj.Width = 250 'uint is mm
obj.Height = 150 'uint is mm
obj.ColorMode = 1 '1--white&black 0--256color mode

obj.AddFontPath "D:\Program Files\AutoCAD 2005\Fonts"
obj.InputFile = "E:\tempaa\44650-39b.dwg"

obj.PenWidth(1) = .1 'set line width, unit in mm
obj.PenWidth(2) = .1 'set line width, unit in mm
obj.PenWidth(3) = .1 'set line width, unit in mm
obj.PenWidth(4) = .1 'set line width, unit in mm
obj.PenWidth(5) = .1 'set line width, unit in mm

obj.PsPath = "c:\winnt\system32\ps"
obj.Convert "E:\tempaa\44650-39b1.pdf"


IConvertPDF::PsPath

property PsPath

specified the ps path.
Property Let PsPath As String

No parameters

must setting PsPath before using convert method.


IConvertPDF::ViewCount

property ViewCount

Get the drawing's layout count.

Property Get ViewCount As Long

No parameters

use Viewcount after the method InputFile

for example vb script:

Dim objImage
Set objImage = CreateObject("DWGTOPDFX.ConvertPDF")

objImage.Width = 1024
objImage.Height = 768
'objImage.Background = 0
objImage.InputFile = "d:\aa.dwg" '"8th floor furniture.dwg"

objImage.Convert "e:\testa.pdf"

For I=1 to objImage.ViewCount
strViewName = objImage.ViewName(I)

strOutput = strViewName&".pdf" 'output file name, include path
objImage.ConvertView strOutput, strViewName
Next
If Err.Number < 0 Then
MsgBox Err.Description
End If


IConvertPDF::ViewName

property ViewName

Get layout name by layout index.

Property Get ViewName(nIndex As Long) As String

Parameters

No | Name | Type | Optional | Default | Description
1 | nIndex | Long | No | - | layout index

use ViewName after the method InputFile.


IConvertPDF::Width

property Width

specifing the output PDF file width , unit is millimeter.

Property Let Width As Double

No parameters


Interface: IConvertPDF

IConvertPDF members

Properties

Name | Type | HelpString | Category | Frequency of use
AddFontPath | Method | method AddFontPath | General | Normal
ColorMode | Property Let | property ColorMode | General | Normal
Convert | Method | method Convert | General | Normal
ConvertView | Method | method ConvertView | General | Normal
DPI | Property Let | property DPI | General | Normal
Height | Property Let | property Height | General | Normal
InputFile | Property Let | property InputFile | General | Normal
PenWidth | Property Get/Let | property PenWidth | General | Normal
PsPath | Property Let | property PsPath | General | Normal
ViewCount | Property Get | property ViewCount | General | Normal
ViewName | Property Get | property ViewName | General | Normal
Width | Property Let | property Width | General | Normal