URL パラメーターを使用して PDF 内のブックマークにリンクすることはできますか?

StackOverflow https://stackoverflow.com/questions/125632

  •  02-07-2019
  •  | 
  •  

質問

Web サイト上の PDF ファイルへのリンクを提供する場合、PDF ブラウザー プラグイン (使用されている場合) を最初から開くのではなく特定のブックマークにジャンプさせる情報 (リクエスト パラメーター) を URL に含めることはできますか?

何かのようなもの: http://www.somehost.com/user-guide.pdf?bookmark=chapter3 ?

ブックマークではない場合、特定のページに移動することはできますか?

答えがあるとしたら、それは Adob​​e の PDF リーダー プラグインか何かに固有であり、バージョン制限があるのか​​もしれないと推測していますが、私が最も興味があるのは、そのテクニックがそもそも存在するかどうかです。

役に立ちましたか?

解決

はい、番号または名前付きの場所で特定のページにリンクでき、それは常に機能します。 ユーザーのブラウザが PDF ファイルを表示するためのプラグインとして Adob​​e Reader を使用している場合.

番号による特定のページの場合:

<a href="http://www.domain.com/file.pdf#page=3">Link text</a>

名前付きの場所 (目的地) の場合:

<a href="http://www.domain.com/file.pdf#nameddest=TOC">Link text</a>


Acrobat を使用して PDF 内に宛先を作成するには:

  1. PDF 内を手動で移動して目的の場所に移動します
  2. [表示] > [ナビゲーション タブ] > [目的地] に移動します。
  3. [オプション] で、[ドキュメントのスキャン] を選択します。
  4. これが完了したら、「オプション」メニューから「新しい宛先」を選択し、適切な名前を入力します。

他のヒント

RFC 3778 セクション 3 では、PDF ファイルで使用できる「フラグメント識別子」を指定します。これには、nameddest と page が含まれます。

処理できるクエリ パラメータは複数あります。以下の完全なリスト:

ソース

+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| Syntax                  | Description                                                                                  | Example                                              |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| nameddest=destination   | Specifies a named destination in the PDF document                                            | http://example.org/doc.pdf#Chapter6                  |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| page=pagenum            | Specifies a numbered page in the document, using an integer                                  | http://example.org/doc.pdf#page=3                    |
|                         | value. The document’s first page has a pagenum value of 1.                                   |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| comment=commentID       | Specifies a comment on a given page in the PDF document. Use                                 | #page=1&comment=452fde0e-fd22-457c-84aa-             |
|                         | the page command before this command.                                                        | 2cf5bed5a349                                         |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| collab=setting          | Sets the comment repository to be used to supply and store                                   | #collab=DAVFDF@http://review_server/Collab           |
|                         | comments for the document. This overrides the default comment                                | /user1                                               |
|                         | server for the review or the default preference. The setting is of the                       |                                                      |
|                         | form store_type@location, where valid values for store_type are:                             |                                                      |
|                         | ● DAVFDF (WebDAV)                                                                            |                                                      |
|                         | ● FSFDF (Network folder)                                                                     |                                                      |
|                         | ● DB (ADBC)                                                                                  |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| zoom=scale              | Sets the zoom and scroll factors, using float or integer values. For                         | http://example.org/doc.pdf#page=3&zoom=200,250,100   |
| zoom=scale,left,top     | example, a scale value of 100 indicates a zoom value of 100%.                                |                                                      |
|                         | Scroll values left and top are in a coordinate system where 0,0                              |                                                      |
|                         | represents the top left corner of the visible page, regardless of                            |                                                      |
|                         | document rotation                                                                            |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| view=Fit                | Set the view of the displayed page, using the keyword values                                 | http://example.org/doc.pdf#page=72&view=fitH,100     |
| view=FitH               | defined in the PDF language specification. For more information,                             |                                                      |
| view=FitH,top           | see the PDF Reference.                                                                       |                                                      |
| view=FitV               | Scroll values left and top are floats or integers in a coordinate                            |                                                      |
| view=FitV,left          | system where 0,0 represents the top left corner of the visible                               |                                                      |
| view=FitB               | page, regardless of document rotation.                                                       |                                                      |
| view=FitBH              | Use the page command before this command.                                                    |                                                      |
| view=FitBH,top          |                                                                                              |                                                      |
| view=FitBV              |                                                                                              |                                                      |
| view=FitBV,left         |                                                                                              |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| viewrect=left,top,wd,ht | Sets the view rectangle using float or integer values in a                                   |                                                      |
|                         | coordinate system where 0,0 represents the top left corner of the                            |                                                      |
|                         | visible page, regardless of document rotation.                                               |                                                      |
|                         | Use the page command before this command.                                                    |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| pagemode=bookmarks      | Displays bookmarks or thumbnails.                                                            | http://example.org/doc.pdf#pagemode=bookmarks&page=2 |
| pagemode=thumbs         |                                                                                              |                                                      |
| pagemode=none           |                                                                                              |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| scrollbar=1|0           | Turns scrollbars on or off                                                                   |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| search=wordList         | Opens the Search panel and performs a search for any of thewords in the specified word list. | #search="word1 word2"                                |
|                         | The first matching word ishighlighted in the document.                                       |                                                      |
|                         | The words must be enclosed in quotation marks and separated byspaces.                        |                                                      |
|                         | You can search only for single words. You cannot search for a string of words.               |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| toolbar=1|0             | Turns the toolbar on or off.                                                                 |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| statusbar=1|0           | Turns the status bar on or off.                                                              |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| messages=1|0            | Turns the document message bar on or off.                                                    |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| navpanes=1|0            | Turns the navigation panes and tabs on or off.                                               |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| highlight=lt,rt,top,btm | Highlights a specified rectangle on the displayed page. Use the                              |                                                      |
|                         | page command before this command.                                                            |                                                      |
|                         | The rectangle values are integers in a coordinate system where                               |                                                      |
|                         | 0,0 represents the top left corner of the visible page, regardless of                        |                                                      |
|                         | document rotation                                                                            |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+
| fdf=URL                 | Specifies an FDF file to populate form fields in the PDF file beingopened.                   | #fdf=http://example.org/doc.fdf                      |
|                         | Note: The fdf parameter should be specified last in a URL.                                   |                                                      |
+-------------------------+----------------------------------------------------------------------------------------------+------------------------------------------------------+

それを付け加えてみる価値はある ウェインの解決策 また 作品 で:

  • Chrome (v 以降)2011 年からの 14 を参照 この問題 詳細については) (v でテスト済み)44)、
  • Firefox (v でテスト済み)40)、
  • Opera (v でテスト済み)31)、

...しかし、それは 機能しない で:

  • サファリ (v.8) (ただし、Apple の Safari バグ トラッカーには機能リクエストがあります)

PDF オープンパラメータ 使用できる URL フラグメントを文書化します。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top