AcroExch.AVPageView: GetAperture メソッド

TOP > AcroExch.AVPageView > *


説明

現在表示しているPDFページの四方サイズ(AcroRectオブジェクト)を返します。

形式

CAcroRect* GetAperture();

引数

  1. 無し。

戻り値

  • AcroRectオブジェクトにポイントでサイズが返されます。

動作するバージョン

Acrobat動作備考
4Acrobat 4.0    ※Windows 98SE + Excel 2000
5Acrobat 5.0.5
6Acrobat 6.0.3 Pro
7Acrobat 7.0.9 Pro
Acrobat 7.1.4 Pro
8OKAcrobat 8.1.2 Pro
9Acrobat 9.3.2 Extended
10Acrobat X (10.1.8) Extended
11Acrobat XI (11.0.04) Extended
  • OK:動作します。
  • NO:動作しない。 戻り値が0を返します。
  • ―:未確認。

サンプル:ExcelのVBA

現在表示しているPDFページのサイズ(AcroRect)を取得します。

  • 事前に参照設定をします。
  • F8キーでステップ実行しながら動作確認します。
001 Sub AcroExch_AVPageView_GetAperture() 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 objAcroRect As Acrobat.AcroRect 008 009 'Acrobatを起動表示する 010 lRet = objAcroApp.Show 011 'PDFドキュメントを開く 012 lRet = objAcroAVDoc.Open("E:\Test04.pdf", "") 013 'AVPageViewオブジェクトを作成する 014 Set objAVPageView = objAcroAVDoc.GetAVPageView 015 016 '現在のページの四方サイズ(AcroRect)を得る 017 lRet = objAVPageView.Goto(1) '2ページ目へ移動 018 019 Set objAcroRect = objAVPageView.GetAperture 020 With objAcroRect 021 Debug.Print "objAcroRect.Bottom=" & .bottom 022 Debug.Print "objAcroRect.Left =" & .Left 023 Debug.Print "objAcroRect.Right =" & .Right 024 Debug.Print "objAcroRect.Top =" & .Top 025 End With 026 Debug.Print "" 027 lRet = objAVPageView.Goto(2) '3ページ目へ移動 028 029 Set objAcroRect = objAVPageView.GetAperture 030 With objAcroRect 031 Debug.Print "objAcroRect.Bottom=" & .bottom 032 Debug.Print "objAcroRect.Left =" & .Left 033 Debug.Print "objAcroRect.Right =" & .Right 034 Debug.Print "objAcroRect.Top =" & .Top 035 End With 036 037 '保存しないでPDFドキュメントを閉じる 038 lRet = objAcroAVDoc.Close(1) 039 040 'Acrobatを閉じる 041 lRet = objAcroApp.Hide 042 lRet = objAcroApp.Exit 043 044 'オブジェクトを強制解放する 045 Set objAcroAVDoc = Nothing 046 Set objAcroApp = Nothing 047 048 End Sub

 

 

補足

  • ページによってAcroRectオブジェクトのポイント値は変わる。
  • 上記サンプルのデバッグウインドウの実行結果
    objAcroRect.Bottom=549
    objAcroRect.Left =-524
    objAcroRect.Right =805
    objAcroRect.Top =-173
    objAcroRect.Bottom=718
    objAcroRect.Left =-412
    objAcroRect.Right =917
    objAcroRect.Top =-4
  • AcroRectオブジェクト」も参照。

Adobe Web 解説

OLE Automation / AcroExch.AVPageView / GetAperture (公式サイト・英語)

動作確認環境

  • WindowsXP Pro(+ SP3) +
    Acrobat 8.1.2 Pro + Office 2003 + MicrosoftUpdate

戻る

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA



SAMURAI Plugin

コメントをする時は出来れば以下もお願いします。

  • OS名 バージョン
  • Acrobat バージョン
  • ツール(Excel等) バージョン
コメントにサンプルコードを入れる時はコードを全て全角文字列にしてください。コチラで半角に戻します。それでもエラーが回避できない時はコメント下さい。個別に対処します。



お仕事で当サイトを見ている方へ
考え込んだら、ご質問下さい。
一緒に解決策を考えましょう。

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください