activePDF Toolkit 2011 API リファレンス
LineWidth
テクニカル リファレンス > Toolkit オブジェクト > Toolkit メソッド > LineWidth

Glossary Item Box

説明: DrawTo メソッドで描画された線の幅を設定します。
構文: object.LineWidth Width, PageNr
引数: 引数 値の型 説明 & 設定
object N/A Set to an instance of the object.
Width Float 線の幅。PDF の表示単位で指定します。
PageNr Long オプション

0 = 新規または現在開いているページにリンクを追加します。(デフォルト)

>1 = 指定したページで動作

-1 = すべてのページで動作
例:
'LineWidth Example
Set TK = CreateObject("APToolkit.Object")

r = TK.OpenOutputFile("LineWidth.pdf")

'Draw a border around the PDF
strPageWidth = 612 '8.5" (72 = 1")
strPageHeight = 792 '11" (72 = 1")
strSpace = 20 'Space between edge of page and border

'Set the width of the line from DrawTo
TK.LineWidth 5, 0

'Top of the page line
TK.MoveTo strSpace, strPageHeight - strSpace, 0
TK.DrawTo strPageWidth - strSpace, strPageHeight - strSpace, 0

'Left of the page line
TK.MoveTo strPageWidth - strSpace, strPageHeight - strSpace, 0
TK.DrawTo strPageWidth - strSpace, strSpace, 0

'Bottom of the page line
TK.MoveTo strSpace, strSpace, 0
TK.DrawTo strPageWidth - strSpace, strSpace, 0

'Right of the page line
TK.MoveTo strSpace, strSpace, 0
TK.DrawTo strSpace, strPageHeight - strSpace, 0

TK.CloseOutputFile

Set TK = Nothing