How to add an almost-GDPR-compliant print button to any website
Update 30.11.2020: Explain why I removed the print buttons from my blog.
Many websites look great on screen but don't support printing or don't look good on paper. Mostly this is because the website designer "forgot" to test and optimize for printing.
To help with this problem, there are free services that can print any website. I know and use two such services: PrintFriendly and PrintWhatYouLike. Unfortunately no service works perfectly, usually one or the other produces better looking results. Both offer adding a "print" button on your website and generate some Javascript/HTML for that.
Upon closer analysis it turns out that these buttons are very much not cool from a GDPR compliance perspective: The buttons load an image and additional Javascript when your website loads so that the people running those print services get a very nice access log of your users reading your website!To solve this problem, I modified the print buttons to be more data privacy friendly:
- inline the image for the print button
- load additional Javascript/CSS resources from the print service only when the user clicks on it
- show a notice that printing uses an external website
Comparing Results
- PrintWhatYouLike, PrintFriendly and Chrome don't show the embedded JSFiddle with the source code
- PrintWhatYouLike cuts off the paragraph under the table
- Firefox truncates the URL in the page footer in the default configuration (can be changed by having only the URL in the footer and putting the other info in the header)
What's next?
The Code
Installing the print button
Simply copy the above code - one or both buttons - to your website. Follow the instructions provided by PrintFriendly and paste this code instead of the generated one.
For Blogger, you will have to edit the HTML of your theme and add the code after the <data:post.body/> element (click in the XML text and press Ctrl-F to search):
Please let me know how this works for you.
Here are the print buttons to try out:
Print (via PrintWhatYouLike, a 3rd party service)
In the end...
In the end I decided that I unfortunately cannot fix printing for everybody and removed this solution from my blog. People who need to print and don't like the result of their browser will need to use the printing services themselves.
Another issue is that my Blogger theme got somehow messed up and wouldn't show the comments any more. Lesson learned here is that I shouldn't manually edit the Blogger theme as long as I don't want to deal with fixing it later when something stops working.
Some day I will have the time and move this blog to a better hosting - or even run my own system - which can be better optimized for printing. Till then it stays as it is.
I apologize for the invonvenience.
Comments
Post a Comment