Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

Learn More

Howto include embedded links when printing to PDF?

  • 2 답장
  • 3 이 문제를 만남
  • 14 보기
  • 최종 답변자: mikemtnbikes

more options

I often print files out to share with students electronically and I want them to have access to the external links of a page. When trying to 'print' a file to PDF from the 'File->Print' context or 'Print Edit WE' addon, the URL links embedded in the original page are not retained. Is there a simple way to change this behavior.

I am running FF 56.0 on Ubuntu 16.04.

I often print files out to share with students electronically and I want them to have access to the external links of a page. When trying to 'print' a file to PDF from the 'File->Print' context or 'Print Edit WE' addon, the URL links embedded in the original page are not retained. Is there a simple way to change this behavior. I am running FF 56.0 on Ubuntu 16.04.

모든 댓글 (2)

more options

Unfortunately, embedded links are not retained when printed. Firefox is sending the output in a format intended for a printer, not for an electronic document.

You may have noticed that some websites use a print style sheet to show all the links in parentheses after the link text in printouts. It often looks hideous. The trick is using a generated content style rule. As an example, you can open the Web Console on a page you want to print, execute a script, then use Print Preview to look at where the URLs are noted in parentheses.

To show the Web Console on the current tab, you can use either:

  • "3-bar" menu button > Developer > Web Console
  • (menu bar) Tools > Web Developer > Web Console
  • (Windows) Ctrl+Shift+k

An example script is as follows:

var s = document.createElement("style"); var t = '@media print{a:not([href^="javascript:"])::after { content: " (" attr(href) ")"; color: #000; }}'; s.appendChild(document.createTextNode(t)); document.body.appendChild(s);

This is a bit all or nothing, so it would be nicer to use a tool that adds just the URLs you care about...


Another possibility would be to use an add-on to generate the PDF. I don't recall whether I tested link preservation when I posted the following last month:

https://discourse.mozilla.org/t/so-many-pdf-converters/20193

more options

Darn. I was hoping for a simpler solution. Thanks for the information.