17

I print a lot of web pages to pdf, using CutePDF. URLs are maintained as active links in the pdf document, but hyperlinks do not generate an active link.

Is there any, preferably free, pdf printer that maintains active hyperlinks, when printing webpages?

(And please, do not advice any tool that does not specifically do this)

I use Firefox, but don't think the browser should matter.

bretddog
  • 647
  • 3
  • 9
  • 19
  • Not sure what exactly you mean by masked hyperlinks. According to known definition of [masked hyperlink](http://www.linktrackr.com/blog/what-is-link-masking/) it should not matter for a pdf printer. In fact PDF printer has no way of knowing where does the hyperlink lead to, so it does not distinguish between masked and non-masked links. – Art Gertner Sep 10 '14 at 08:03
  • smc; I simply mean normal text which has a hyperlink, such as; [superuser](http://www.superuser.com) If masked is incorrect, what is the term for this? – bretddog Sep 10 '14 at 08:16
  • The term is **hyperlink**. Has nothing to do with masking. Plain text is called **URL**. Hyperlink is clickable object that takes you to **URL**. Please read [wiki:Hyperlink](http://en.wikipedia.org/wiki/Hyperlink) and [wiki:URL](http://en.wikipedia.org/wiki/Uniform_resource_locator). Also don't forget to update yor question (including title) – Art Gertner Sep 10 '14 at 08:29

5 Answers5

8

Using Chrome's "save as PDF" integrated virtual printer is another option. It worked for me where the "print pages to PDF" Firefox extension messed the page badly (but indeed preserved the hyperlinks)

hetchel
  • 81
  • 1
  • 5
  • W3C documents such as http://www.w3.org/TR/xmlschema11-1/#composition-schemaImport don't seem to work with that approach: The linked document is NOT searchable and the links DO NOT work. – koppor Oct 07 '15 at 03:57
  • 2
    Just tested that page, with the latest version of Chrome. The document IS searchable and external links DO work. Internal links (to an anchor in the page), DO NOT work (which is quite a problem for this type of document). Using "Print pages to PDF" seems to give a better result with that page: searchable, and with external AND internal links working, and it seems to preserve the layout properly. – hetchel Oct 09 '15 at 15:39
7

First I have to assure you that it matters what browser you are using. Unless you are using the standard OS print dialog, the browser will use its own library to create the PDF. Results will vary between different browsers.

Just as experiment I have printed this page using Firefox and Chromium. Firefox did not save any clickable links. Chromium saved about 50% and the selection seemed to be pretty random.

I believe the best solution for you would be to install a browser add-on / extension that will do the job.

I made a quick search and for Firefox I have found this one: the unimaginatively named Print pages to Pdf. Direct link to the latest version: 0.5.0.6.

Creates one Pdf from any amount of open Browsertabs,Bookmarks/-folder, Scrapbook(Plus) pages. This document can be archived, sended [sic] by e-mail or printed out with any standard Pdf Viewer.

if you go through the list of features you will find what you are looking for:

  • Retains links in the pdf from the content of webpages
  • Supports local links for navigating in the webpage/pdf

I have tested it briefly and it printed the page correctly with all clickable links.

Art Gertner
  • 7,149
  • 11
  • 42
  • 72
  • Well this looks quite awesome! :) So far good results and some nice options. Thanks! – bretddog Sep 10 '14 at 21:44
  • 1
    These links are dead. – AllInOne Apr 11 '17 at 14:14
  • 1
    @AllInOne, updated – Art Gertner Apr 11 '17 at 18:54
  • @ArtGertner Links to any version of this are dead. (I loved the plugin before..) – Malachi Apr 11 '18 at 14:32
  • Update 2022 for Firefox as main browser this [Save as Pdf addon](https://addons.mozilla.org/en-US/firefox/addon/save-as-pdf/) works. That is not full-featured free though, so, we can open the page in Chrome from Firefox and use its 'print to pdf' integrated tool which keeps links, as said in another answer. To do that with ease, we can use ['Open with' addon](https://addons.mozilla.org/en-US/firefox/addon/open-with/) or one of the many 'open with Chrome' addons. – cipricus Feb 25 '22 at 11:14
3

wkhtmltopdf

Based on Print pages to Pdf, I suggest the stand alone tool wkhtmltopdf.

"c:\Program Files\wkhtmltopdf\bin\wkhtmltopdf" "http://www.example.com" test.pdf

Pandoc

wkhtmltopdf didn't work in my case, therefore I recommend Pandoc. It is a bit more complicated to get it running. With small documents, you should be able to run

pandoc http://www.example.org/ -o test.pdf

When you have UTF-8 documents with Chinese characters, you have to do it like follows:

pandoc http://blog.fefe.de/ -o test.tex
lualatex test.tex
lualatex test.tex

work-in-progress

However, in my concrete setting pandoc http://www.w3.org/TR/DOM-Parsing/ -o test.pdf, it lead to a LaTeX error.

! LaTeX Error: Too deeply nested.

Therefore, I did create the latex file manually:

pandoc http://www.w3.org/TR/DOM-Parsing/ --standalone -o test.tex

Then, I had to disable line 78, because an \includegraphics was within \href.

With a hack suggested at stackoverflow (inserted at line 74, right before \begin{document}), I also could not got it running (pdflatex test).

I opened issue #2438 at Pandoc.

koppor
  • 546
  • 2
  • 6
  • 19
2

The plugin Print pages to Pdf is no longer available on Firefox. I tried the alternative listed in this and other threads but had no luck.

What does work:

  • Use the Adobe PDF toolbar for Internet Explorer.
  • Use the "Convert Web Page to PDF" function in the toolbar.
  • As of 2015-10-07, Print pages to Pdf is still available: See http://printpdf.pf-control.de/index.php/en/0.5.0.2.html – koppor Oct 07 '15 at 04:06
  • Thanks for your comment. I checked the site you linked and followed instructions to how to install ( http://printpdf.pf-control.de/index.php/en/installation.html ) That page links to https://addons.mozilla.org/en-US/firefox/addon/print-pages-to-pdf/ where it says "This add-on has been removed by its author." – Erik T. Wiik Oct 08 '15 at 23:38
  • Please follow the link given in the first paragraph of my link. The text reads "If you want download this Version you can do it by this link. (If you already downloaded 0.5.0.1 this one identical)". "This link" links to http://printpdf.pf-control.de/versions/0.5.0.2/xpi/[email protected] – koppor Oct 09 '15 at 16:56
1

There's a FireFox Addon "save-as-pdf", that does save the hyperlinks in the PDF document: https://addons.mozilla.org/en-US/firefox/addon/save-as-pdf/

(it is free, but developed by a commercial company http://pdfcrowd.com )

Noam Manos
  • 1,804
  • 1
  • 20
  • 20
  • It is worth mentioning that this conversion is done online. The addon sends the URL to pdfcrowd's online service which converts it and gives back the PDF. I won't use that addon due to privacy concerns - I don't want to know pdfcrowd which sites I am interested in. Furthermore, be prepared for all sorts of leaks of sensitive data when using that service (confidential contents of the page in question, session ids coded into the URL and so on), and for the addon not working if login data / session id is given to the website in question via post requests. – Binarus Jun 04 '17 at 20:04