14 September 2015

How to Print Multiple Gmail Messages in one go


John Q. Public is an attorney at a law firm and, as part of an ongoing litigation, the court has asked their clients to produce hundreds of email conversations associated with a case as hard copies. They are using Gmail with Google Apps and all the emails are safely stored in the mailbox but how to automatically print them all on paper?

Gmail doesn’t offer an option to print multiple email threads in a batch but that feature is available in Microsoft Outlook, the desktop program. You can import Gmail emails into Outlook, select several messages and then hit the Print button. Outlook will group all the selected email messages into a single PDF file or you can send them directly to any connected printer.

Bulk Gmail Printing
There’s an alternate approach as well. You can select multiple emails in Gmail and apply a common label. Next use an add-on to save these emails as neatly-formatted PDF files into your Google Drive. Once the PDFs are ready, you can either print them through Google Cloud Print or download the PDF files to the desktop and print to the local printer.

Here’s a step by step guide on how to print email messages and attachments in Gmail in bulk:

  1. Go to Gmail, select one or more email threads and apply a common label (like To Print) to all the selected email threads.
  2. Go to Google Drive and create a folder, say Gmail Files, where the selected Gmail messages would be stored as PDFs.
  3. Download and install the Save Emails add-on for Google Sheets.
  4. Inside the Google Sheet, go to Add-ons > Save Emails and Attachments > Create New Rule. Here select the Print Gmail label from the dropdown and then select your Google Drive folder.

Click the Create Rule button button and the add-on will save your marked Gmail emails into Google Drive every hour. Or you can go to the Manage Rules menu and run a rule manually to immediately save the marked email threads (including attachments) into Drive.

Print Gmail
Once all the emails have been saved, right-click the “Gmail Files” folder in Google Drive, and choose Download to save all emails to your desktop. And now you can send them all the emails to the printer with the simple Ctrl+P or (Cmd+P on Mac) keyboard shortcut.

Also see: How to Edit PDF Files


The story, How to Print Multiple Gmail Messages in one go, was originally published at Digital Inspiration by Amit Agarwal on 14/09/2015 under GMail, PDF, Print, Internet.

How to Hide AdSense Ads on your Website


Google AdSense supports Responsive Ads which means that the size of AdSense ads on your website will automatically change based on the visitor’s device. Thus, if they are viewing your pages on a desktop computer, they may be served the bigger 728×90 leaderboard while the same ad unit may serve a smaller 468×60 banner to visitors who are on a tablet.

There’s no need to change the code as the AdSense script smartly detects the browser’s width and serves the right size accordingly.

Now consider a slightly different scenario where, instead of showing a smaller sized ad, you would like to completely hide the AdSense ad if the screen width is less than ‘n’ pixels. For instance, you may have a 160×600 px Skyscraper unit in your website’s sidebar but it should be displayed only when the site is being viewed on a desktop computer and not on a mobile phone.

There are two ways to achieve this. You can either write a CSS media query that will completely hide the sidebar on a mobile phone and thus the included AdSense ad will also be hidden from the visitor. This will however be against AdSense program policies because the AdSense ad will still be rendered on the visitor’s screen though hidden from view.

How to Hide AdSense Ads with CSS Media Queries

What we therefore need is a mechanism where the the AdSense ad is itself ‘blocked’ from rendering on a small screen. This is also possible with CSS media queries but the big difference is that we need to apply the CSS rules to the ad element and not the parent container (which in our case is the sidebar). Let me explain:

AdSense Ad Code

What you see above is a standard AdSense code snippet that will render a 160×600 pixels ad unit. The size (height and width) of the ad is specified as an inline style.

If you copy-paste the above ad unit as is into your website, it will always download and render the ad irrespective of the visitor’s screen size. If you however need to prevent the AdSense ad from showing on small screens, we need to make a few “officially permitted” changes to the default code.

The modified code will look something like this:

Hide AdSense Ads

If you carefully notice the two snippets, you’ll find that we’ve added a new class sidebar_ads (you can give it any name) to the default AdSense snippet. Next we’ve added a media query that will hide all elements of this class if the screen width is less than 480 pixels. That’t it.

With this approach, no ad requests is made to the Google server and thus no ad is shown to the visitor. The ad area will be hidden and the content below will get pushed up leaving no whitespace, just as you’d like it to be.


The story, How to Hide AdSense Ads on your Website, was originally published at Digital Inspiration by Amit Agarwal on 14/09/2015 under Google AdSense, Internet.