We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Докладніше

Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.

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.