Google Sheets Script. Range 2 Image

Max Makhrov
2 min readAug 1, 2022

--

Hi, this is Max from Cooltables!

Here’s the demo:

🙌 The latest version of the script goes with the Cooltables add-on. Here is how to capture range screenshots without code:

Cooltables

The Range to Image feature inside Cooltables:

  • 10x faster, especially for larger ranges.
  • 📐 Images are precisely cropped — no unwanted white space.
  • 🔍 Smarter scaling to handle even bigger spreadsheet captures.
  • 🖥️ Larger preview area to view images clearly.

Cooltables also includes additional handy tools you’ll discover and appreciate.

How to get started:

  1. Open any Google Sheet.
  2. Go to Extensions → Add-ons → Get add-ons.
  3. Search Cooltables and click Install.

To convert a range to an image:

Just select your range, then click:
Extensions → Cooltables → Tools → Convert Selected Range to Image

The script converts the selected range to a high-resolution image.

How it works

It creates an URL for PDF first and then uses Canvas and Pdf.js to convert it into PNG.

Instruction:

  1. Select a range
  2. Use the custom menu to launch the script. Authorize and rerun it when you do it the first time.
  3. Wait until the image is rendered.
  4. Optionally right-click the image and save/copy it to your computer.

Issues

We want to solve this issue:

  1. We cannot capture emojis, bug by Google. If you are interested in fixing it, please vote here.

Benefits

We recommend using the script if:

  1. You need to create a screenshot and use it later: send it to Telegram or email or use it in Slides.
  2. You want to create an image of cells as you see them on screen, containing images, charts, sparklines, etc.
  3. You want to create a screenshot of a range that does not fit your screen.
  4. You want to create a screenshot of a range with high resolution.

The code

The script is still under construction. You’re welcome to join our tests:

--

--

Max Makhrov
Max Makhrov

Written by Max Makhrov

Google Sheets Developer, automation expert

Responses (1)