Wednesday, July 31, 2013

Gmail pdf attachments to Blogger embedded jpeg

I maintain a blog for a bunch of old people who don't know what blogging is so they send emails instead of just making it a blog to begin with...  These people send me attachments... PDF attachments.

What I HATE to do is download the file then upload it back again.  It makes it worse to download, convert to jpg, and then upload just to embed the jpeg version of the PDF into the post!

I found a work around today.

[Add Gmail attachments to gDrive]

UPDATE: Gmail rolled out the ability to simply click the attachment and preview or move it in your gDrive!
OLD INFO: First we need to get the PDFs into google drive.  When googling "gmail attachments to drive" I came across this fancy script that can be used to pull all gmail attachments into your google drive: http://www.labnol.org/internet/send-gmail-to-google-drive/21236/

Once the PDF attachments are in gDrive open it in the gDrive Viewer (in most cases that means click on the title/link and choose "Open" in the bottom right of the page.


Viewing the PDF via gDoc viewer gives you a jpeg for each page of the PDF (google's best effort of what it should look like).

Here is where the magic happens...

[Use the gDrive PDF Preview image as the image in your blog]

Simply right-click on the image (jpeg), choose "Copy Image URL", go to your blog and add an image via URL... BLAMO!



All this together enables you to get an attachment in an email, post that (a representation of it) inline in a post, all without downloading a single thing!

I go the extra mile of setting the Share permissions of the PDF to "Anyone who has the link can view" and adding a link to the PDF along with the inline jpeg.

And if the attachment is generic and might be used in future posts (like a parent permission slip) then I make a separate post that is just the inline-jpeg/pdf-link and link posts to it.

No comments:

Post a Comment