Some modern browsers convert links like
<a href="http://somesite.com">Site</a>
into
Site (http://somesite.com)
as part of the generated PDF.
Is there a way to omit the links from the generated PDF version by pure CSS?
Which CSS classes in the print.css must be defined in order to suppress the link URLs?
Google Chrome: Go to the Menu icon in the top right corner of the browser and Click on Print button. Uncheck the “Headers and footers” option underneath the “Margins” option. Apple Safari: Go to the print option from the menu and the Print dialog appears. Uncheck the “Print headers and footers” option.
The print() method prints the contents of the current window. The print() method opens the Print Dialog Box, which lets the user to select preferred printing options.
Print out the PDF and put the page/s back in the printer. Viewing the PDF in the Adobe Reader in Chrome, go Hamburger menu > Print ... and it should show as a blank page. Select to add the URL header. Print as many copies as there were pages in the original PDF, and the URL will be overlaid.
Here is an example for the way to manipulate the styling of <a href=...>
tags inside a CSS file to make it appear as you dislike it:
@media print {
##....
a[href]:after {
content:" ("attr(href)")";
color:#868686;
background-color:inherit;
font-style:italic;
size:90%;
}
##....
}
To override this setting (and make it appear more to your liking), you may need to use a (user) print.css which contains the following (as part of its total content):
a[href]:after {
content:"" !important;
}
Your question is not very clear about the scope of your requirement:
If you want the first, you put the reference to your print.css into the HTML header section the usual way and host the file on your web server
If you want the second, you should google for "user stylesheets" to find links like the following:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With