TOP > AcroExch.PDDoc > *
説明
指定されたページを取得し、PDPageオブジェクトを返します。
形式
LPDISPATCH AcquirePage(long nPage);
戻り値
- PDFファイルの指定されたページを取得し、PDPageオブジェクトを返します。
- 取得出来ない時はNullを返します。
引数
- 第1引数(long nPage):
取得するページ番号を指定します。
開始ページは0から。
動作するバージョン
| 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
Test01.PDFの指定されたページのサイズ(幅,高さ)をポイントオブジェクトで返します。
- 事前に参照設定をします。
- F8キーでステップ実行しながら動作確認します。
001 Sub AcroExch_PDDoc_AcquirePage()
002
003 Dim objAcroAVDoc As New Acrobat.AcroAVDoc
004 Dim objAcroPDDoc As Acrobat.AcroPDDoc
005 Dim objAcroPDPage As Acrobat.AcroPDPage
006 Dim objAcroPoint As Acrobat.AcroPoint
007 Dim lRet As Long
008
009 'PDFファイルを開いて表示する
010 lRet = objAcroAVDoc.Open("E:\Test01.pdf", "")
011 'PDDocを取得する
012 Set objAcroPDDoc = objAcroAVDoc.GetPDDoc
013 '1ページ目のページサイズを取得する
014 Set objAcroPDPage = objAcroPDDoc.AcquirePage(0)
015 Set objAcroPoint = objAcroPDPage.GetSize
016
017 Debug.Print "1ページ目の幅=" & _
018 objAcroPoint.x & "ポイント"
019 Debug.Print "1ページ目の高さ=" & _
020 objAcroPoint.y & "ポイント"
021
022 '現在表示しているPDFファイルを変更無しで閉じる
023 lRet = objAcroAVDoc.Close(1)
024
025 'オブジェクトを強制開放する
026 Set objAcroPoint = Nothing
027 Set objAcroPDPage = Nothing
028 Set objAcroPDDoc = Nothing
029 Set objAcroAVDoc = Nothing
030
031 End Sub
補足
- PDPageオブジェクトへの連携に使用します。
Adobe Web 解説
OLE Automation / AcroExch.PDDoc / AcquirePage (公式サイト・英語)
動作確認環境
- WindowsXP Pro(+ SP3) +
Acrobat 8.1.2 Pro + Office 2003 + MicrosoftUpdate
< 戻る >