How to add an almost-GDPR-compliant print button to any website

Update 03.09.2020: Added results and conclusion.

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
You can try out both print buttons at the end of this page. It is interesting to notice how PrintFriendly and PrintWhatYouLike actually differ in the details:

PrintFriendlyPrintWhatYouLike
Print view customization profileImage alignment
Change page header image and tagline
Custom CSS
Very detailed modification for print: remove backgrounds, margins, images. Remove elements, select container to show, expand to fill page width, change font size
Processingon their serversin your browser (print)
on their servers (pdf download)
Additional resources loaded for printingnothingJavascript, HTML
CSS for printing UI
Interactive adjustment before printChange image and text sizeAll of the above
Commercial / "Pro" offeringAPI, ad-free, client-side processing, GDPR compliantUnclear
Actively maintainedPartially, screenshots of Blogger are outdatedUnclear, last blog post from 2011
StrengthsBetter looking result
Document header with URL and page title
GUI for customizing the print view
WeaknessesMesses up right-justified paragraphsChanges text size of headings to make them look like normal text
GDPR complianceYes, only with paid version (not tested). Free version uses Google AnalyticsNo. Also uses Google Analytics even though the processing is on the users browsers

So with the free versions you are not complete GDPR compliant but you can at least avoid leaking information to the print services as long as your users don't actually use them. And with the paid PrintFriendly offering there is even a GDPR compliant solution available.

Comparing Results

The results are - unfortunately - rather disappointing. If I take this very blog post as a reference, then I must say that no printing solution is really satisfying. Also comparing with the native Browser printing shows deficiencies:
  • 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)
Eventually users will be best advised to print via Firefox or Safari. You can look at the resulting PDFs here.

What's next?

The root cause for my trouble is that the Blogger theme I use doesn't have proper printing support via the @print media query. I am not sure I want to keep these print buttons. While they do help as a workaround they create new problems (not everything is shown).

I'll probably first remove the PrintWhatYouLike button as it doesn't produce much better results and also hides a text paragraph. Then I'll hopefully find time to either find a better theme with proper printing support or I'll maybe find the time to add the missing printing support myself.

The Code

Have a look at the JsFiddle with the code:
If you copy the code and use PrintWhatYouLike then please create a profile for your website and set it in the code instead of mine.

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 Print (via PrintWhatYouLike, a 3rd party service)

Print Print (via PrintWhatYouLike )

Comments

Popular posts from this blog

Setting Custom Page Size in Google Docs - My First Published Google Apps Script Add-On

Ubuntu on Dell Latitude E6420 with NVidia and Broadcom

WARNING is a waste of my time