PDFtoLinks / Blog

Why your PDF links are not extracting

Five reasons a PDF link extractor returns nothing, too few links, or broken ones — and how to tell which problem you have.

Jump to a section

A link extractor that returns an empty list is not necessarily broken, and the document is usually not corrupt either. There are a small number of distinct causes, and each one looks different once you know what to check.

The most common case by far. Someone typed or pasted an address into a document and never made it a hyperlink, or exported from a tool that writes addresses as plain characters. It looks like a link — it may even be blue and underlined, because that is just formatting — but there is no link annotation behind it and nothing to click.

How to check: open the PDF in any reader and hover over one. If the cursor does not become a pointer and nothing happens on click, it is text. No extractor will find it, because there is nothing there to find.

The file is encrypted

Password-protected PDFs cannot be parsed without the password. The structure is encrypted, so the compressed streams will not decompress and the scan comes back with nothing. Some documents are also protected without a password you were ever given — corporate templates often apply permissions automatically.

How to check: if the file asks for a password to open, this is your answer. If it opens fine but you cannot copy text from it, permissions are set, which can have the same effect.

FlateDecode is overwhelmingly the common case, but it is not the only compression a PDF can use. Older or unusual producers may use LZWDecode or a filter chain, and generators aimed at print sometimes do stranger things still. A stream that will not inflate is skipped rather than being allowed to fail the whole extraction, so the result is fewer links rather than an error message.

How to check: if you get some links but visibly fewer than the document contains, and the file came from unusual software, this is a likely cause.

A table of contents that jumps to a chapter, a footnote marker, a cross-reference — these are links, but they are not URI actions. They are internal destinations pointing at another place in the same document, and they have no address to export. A tool looking for external hyperlinks will correctly ignore them.

The URL came out truncated

If you get links but some are cut short or end mid-address, the extractor is mishandling escaped characters. Inside a PDF, a URL containing a round bracket has that bracket escaped with a backslash, and a tool that simply reads up to the first closing bracket stops in the wrong place. Wikipedia URLs with a disambiguation suffix are the classic example.

This one is worth checking rather than assuming, because a truncated URL still looks like a valid result in a list. Spot-check any address that ends abruptly or lacks the page you expected.

If you want to rule the tool out rather than the document, our extractor inflates compressed streams and decodes escaped brackets, so it will find links that a raw byte scan misses. It also explains the mechanics in how to extract every hyperlink from a PDF.

What to do next

  • Hover over a link in a reader to confirm it is genuinely clickable before blaming the tool.
  • If the document is protected and it is yours, remove the protection and try again.
  • Compare the number of links returned against a rough count of what you can see, rather than assuming all or nothing.
  • Check any suspiciously short URL against the original by clicking it in the document.

Frequently asked questions

Why does my PDF link extractor return nothing at all?
Usually because the addresses in the document are plain text rather than real hyperlinks, or because the file is encrypted. Hover over one in a reader: if it is not clickable there, there is nothing to extract.
Why do I get fewer links than the document contains?
Either some links are internal destinations rather than web addresses, or some objects use a compression filter the tool cannot inflate, in which case those streams are skipped rather than failing the whole file.
Why is one of my extracted URLs cut short?
Escaped brackets. A URL containing a round bracket has it written with a backslash inside the PDF, and a tool that reads to the first closing bracket stops early. Addresses with a parenthetical suffix are the usual casualty.

Try it

Our PDF link extractor runs entirely in your browser — the file is never uploaded. More posts.