TOP > AcroExch.AVPageView > *
説明
現在、表示しているPDFページのズームタイプを返します。
形式
short GetZoomType();
引数
- 無し。
戻り値
- ズームタイプを現した数値を返します。
・AVZoomFitHeight(3) : 高さに合わせる
・AVZoomFitPage(1) : 全体表示
・AVZoomFitVisibleWidth(4) : 描画領域の幅に合わせる
・AVZoomFitWidth(2) : 幅に合わせる
・AVZoomNoVary(0) : 第2引数のズーム比で表示 ※再調査
動作するバージョン
| Acrobat | 動作 | 備考 |
|---|---|---|
| 4 | ― | Acrobat 4.0 ※Windows 98SE + Excel 2000 |
| 5 | ― | Acrobat 5.0.5 |
| 6 | ― | Acrobat 6.0.3 Pro |
| 7 | ― | Acrobat 7.0.9 Pro Acrobat 7.1.4 Pro |
| 8 | OK | Acrobat 8.1.2 Pro |
| 9 | ― | Acrobat 9.3.2 Extended |
| 10 | ― | Acrobat X (10.1.8) Extended |
| 11 | ― | Acrobat XI (11.0.04) Extended |
- OK:動作します。
- NO:動作しない。 戻り値が0を返します。
- -:未確認。
サンプル:ExcelのVBA
現在のズームタイプを得ます。
- 事前に参照設定をします。
- F8キーでステップ実行しながら動作確認します。
001 Sub AcroExch_AVPageView_GetZoomType()
002
003 Dim objAcroApp As New Acrobat.AcroApp
004 Dim objAcroAVDoc As New Acrobat.AcroAVDoc
005 Dim objAVPageView As Acrobat.AcroAVPageView
006 Dim lRet As Long '戻り値
007 Dim lGetZoomType As Long
008
009 'Acrobatを起動表示する
010 lRet = objAcroApp.Show
011 'PDFドキュメントを開く
012 lRet = objAcroAVDoc.Open("E:\Test01.pdf", "")
013 'AVPageViewオブジェクトを作成する
014 Set objAVPageView = objAcroAVDoc.GetAVPageView
015
016 '現在のズームタイプを得る
017 lGetZoomType = objAVPageView.GetZoomType
018 Debug.Print "ZoomType=" & lGetZoomType
019
020 '保存しないでPDFドキュメントを閉じる
021 lRet = objAcroAVDoc.Close(1)
022
023 'Acrobatを閉じる
024 lRet = objAcroApp.Hide
025 lRet = objAcroApp.Exit
026
027 'オブジェクトを強制解放する
028 Set objAcroAVDoc = Nothing
029 Set objAcroApp = Nothing
030
031 End Sub
補足
- 「ZoomTo」参照。
Adobe Web 解説
OLE Automation / AcroExch.AVPageView / GetZoomType (公式サイト・英語)
動作確認環境
- WindowsXP Pro(+ SP3) +
Acrobat 8.1.2 Pro + Office 2003 + MicrosoftUpdate
< 戻る >