HOW-TO GUIDE

How to send Gemini only the pages, tabs, or cells of a file you need

Based on a guide by Google on the Gemini API docs · Nov 19, 2026

You'll end with: Gemini API requests that read Word, PowerPoint, and Excel files directly and process only the page range, worksheet tab, or cell range you set.

Why it's worth having: Gemini counts and bills tokens only for the sliced output, so a long spec or bid package costs only the pages you ask about.

At a glance

WHO IT'S FOR
Estimators, project engineers, and developers who build tools that read long specs, bid packages, and spreadsheets.
LEVEL
Intermediate
COST
Free to read. The method needs a Gemini API key and a Gemini 3 or Gemini 4+ model; tokens bill at API rates.
YOU NEED
A Gemini API key · A Gemini 3 or Gemini 4+ model · Word, PowerPoint, Excel, or PDF files

The method, in short

  1. 1Pass the Office or PDF file to Gemini as a document block and add a processing setting to that block.
  2. 2Set page_options with start_page and end_page to read only a page range of a document or a deck.
  3. 3For spreadsheets, set spreadsheet_options with sheet_index for one tab and visible_cells for a range such as A1:H50.
  4. 4Scan a large file with page_text first, then ask for page_image at high resolution only for pages with charts.

The guide has code for each option, the supported file types, and the token cost per page.