本文へスキップ

リンクを追加・編集

文書内の URL をクリックできるようにしたり、外部リンクを取り除いたりします。

お使いの端末で処理

このツールはブラウザーの中だけで動きます。ファイルがアップロードされることはなく、そのことはブラウザーのネットワークタブでご自身で確認できます。 ご自分で確かめてください。ブラウザーのネットワークタブを開いて見てください。残りの作業回数を尋ねる小さなリクエストが1つだけ表示されます。ツール名とハッシュだけで、ファイルは決して含まれません。

このツールでできること

A URL printed in a PDF is usually not a link. It is text that looks like one, because whatever produced the document wrote the characters and never created the annotation that makes them clickable. This tool finds those and makes them real, lets you draw links by hand over anything else, and can strip existing links out. Links are annotations laid over a rectangle, so nothing about the page's appearance changes either way.

The common case is a document exported from a design tool or scanned from print where every web address is dead text. The other direction matters too: stripping outbound links from a document before it goes somewhere untrusted, or before it is published, so nobody follows a tracking address that was fine internally.

仕組み

  1. Drop the PDF onto this page.
  2. Leave automatic detection on for a first pass. Every URL and e-mail address found in the text is listed with the page it sits on.
  3. Draw a rectangle over anything else that should be clickable and give it a web address, or a page number to jump to inside the document.
  4. Turn on replacing existing links if the document already carries some and you would rather start clean.
  5. Press Save links and download the result.

Detection is harder than a regular expression over the page text, which is why most tools that offer it miss half the links. A PDF regularly splits one URL across several text runs, so a naive scan finds "https://exa" and "mple.com/report" and links neither. The runs on each line are joined before matching, which finds the whole address. Trailing punctuation is then trimmed - the full stop that ended the sentence rather than the one inside the domain - and a closing bracket is only dropped when it is unbalanced, because plenty of real addresses end in one and truncating those produces a link that leads nowhere. What is not linked is as deliberate as what is. A bare host with no dot in it is rejected, because in running prose "e.g" and "vs" match far more often than "http://localhost" appears, and a wrong link is worse than a missing one. An address beginning www. gets https:// in front of it, since a bare host is not a URI and readers show the annotation as broken. E-mail addresses become mailto: links, and an address inside a URL is not linked twice.

Links are written without a border and with the print flag set. The first is what stops readers drawing the black box round every link that made documents from the 1990s so recognisable; the second is what keeps the link alive when someone prints the document back to PDF. Internal jumps are written as explicit destinations that preserve the reader's current zoom and land at the top of the target page, rather than as named destinations, which break as soon as anyone splits or merges the file.

Running detection twice on the same document adds a second annotation over the same words unless you turn on replacing existing links first. Two stacked links behave unpredictably - readers pick whichever they find first - so turn that option on for a second pass, and leave it off when the document already carries hand-made links you want to keep.

Stripping outbound links is a separate pass and it ignores everything else on the page: every link with a web address is removed and the internal page-to-page jumps are kept, so a document keeps its own navigation and loses its ability to send a reader anywhere. Sanitise PDF is the wider version of this, removing JavaScript, launch actions and embedded files as well.

Detection needs the text of the document, which is read in your browser by PDF.js, and the annotations are written by pdf-lib in a Web Worker. No address in your document is looked up, resolved or checked against anything - which also means a link to a page that no longer exists is written exactly as printed.

このツールにできないこと

  • Detection can only find what is in the text layer. A scan has no text until it has been through OCR, and an address broken across two lines is read as two fragments, so neither is linked.

よくある質問

PDF の URL が最初からクリックできないのはなぜですか?
PDF のリンクは注釈 — アクションが付いた矩形 — であって、文字の属性ではないからです。Word や多くのデザインツールは URL を貼り付けたときに作りますが、書き出しの経路でそれが失われることがあり、スキャンには最初からありません。あるのは Web アドレスの写真です。自動検出は文字を読み、アドレスを見つけて、足りない注釈をその上に書き込みます。
文書のあるページから別のページへリンクできますか?
できます。矩形を描いて、Web アドレスではなくページ番号を指定してください。ジャンプは明示的な移動先として書き込まれ、読み手の現在の拡大率を保ったまま、対象ページの先頭に着きます。目次全体を作りたいなら、たいていは「ブックマークを編集」のほうが適しています。クリックできる文字ではなく、横のパネルを読み手に渡せます。
PDF からリンクを削除するにはどうしますか?
方法は 2 つあり、効果が違います。既存のリンクを置き換えるをオンにすると、追加したものを書き込む前にすべてのリンクを削除するので、何も追加しなければ全部消えます。外部リンクをすべて削除するほうは、Web を指すものだけを取り除き、ページ間のジャンプは残します。組織の外に出す文書ではこちらが望ましい動作です。
URL の一部しか検出されません。何が起きていますか?
ほぼ確実に改行のせいです。検出器は照合の前に 1 行の中のテキストランを連結するので、1 行の中で複数のランに分かれたアドレスは丸ごと見つかります。しかし次の行に折り返したアドレスは 2 つの断片として届き、どちらも単独では URL に見えません。その場合は手で描いてください。各行に 1 つずつ矩形を置き、どちらにも同じアドレスを設定します。
リンクは確認されたり、どこかに送られたりしますか?
どちらもありません。アドレスの名前解決も取得も検証も行わず、文書がアップロードされることもありません。文字の抽出も注釈の書き込みも、ブラウザ内で行われます。そのかわり、印刷されたアドレスの打ち間違いは、同じ打ち間違いのままのリンクになります。保存する前に、明らかに壊れているものがないかリストで確かめておく価値があります。

関連ツール