> ## AI Agent Context > Get the complete documentation index at: https://aistudio.google.com/llms.txt > Use this file to discover all available pages. > For the full documentation in a single file, fetch: https://aistudio.google.com/llms-full.txt # Document understanding Gemini models can process documents in PDF format, using native vision to understand entire document contexts. This goes beyond just text extraction, allowing Gemini to: * Analyze and interpret content, including text, images, diagrams, charts, and tables, even in long documents up to 1000 pages. * Extract information into [structured output](/docs/structured-output) formats. * Summarize and answer questions based on both the visual and textual elements in a document. * Transcribe document content (e.g. to HTML), preserving layouts and formatting, for use in downstream applications. You can also pass Microsoft Office and OpenDocument files, such as Word documents, PowerPoint presentations, and Excel spreadsheets. For details, see [Office and OpenDocument files](/docs/document-processing#office-documents). Other non-PDF documents, such as TXT, Markdown, or HTML files, are processed as plain text, which eliminates context like charts or formatting. ## Passing PDF data inline {% id="inline_data" %} You can pass PDF data inline in the request to `generateContent`. This is best suited for smaller documents or temporary processing where you don't need to reference the file in subsequent requests. We recommend using the [Files API](/docs/document-processing#large-pdfs) for larger documents that you need to refer to in multi-turn interactions to improve request latency and reduce bandwidth usage. The following example shows you how to fetch a PDF from a URL and convert it to bytes for processing: {% tabs %} {% tab label="Python" %} ```python from google import genai from google.genai import types import httpx client = genai.Client() doc_url = "https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf" # Retrieve and encode the PDF byte doc_data = httpx.get(doc_url).content prompt = "Summarize this document" response = client.models.generate_content( model="gemini-3.8-flash", contents=[ types.Part.from_bytes( data=doc_data, mime_type='application/pdf', ), prompt ] ) print(response.text) ``` {% /tab %} {% tab label="JavaScript" %} ```javascript import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfResp = await fetch('https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf') .then((response) => response.arrayBuffer()); const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(pdfResp).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% tab label="Go" %} ```go package main import ( "context" "fmt" "io" "net/http" "os" "google.golang.org/genai" ) func main() { ctx := context.Background() client, _ := genai.NewClient(ctx, &genai.ClientConfig{ APIKey: os.Getenv("GEMINI_API_KEY"), Backend: genai.BackendGeminiAPI, }) pdfResp, _ := http.Get("https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf") var pdfBytes []byte if pdfResp != nil && pdfResp.Body != nil { pdfBytes, _ = io.ReadAll(pdfResp.Body) pdfResp.Body.Close() } parts := []*genai.Part{ &genai.Part{ InlineData: &genai.Blob{ MIMEType: "application/pdf", Data: pdfBytes, }, }, genai.NewPartFromText("Summarize this document"), } contents := []*genai.Content{ genai.NewContentFromParts(parts, genai.RoleUser), } result, _ := client.Models.GenerateContent( ctx, "gemini-3.8-flash", contents, nil, ) fmt.Println(result.Text()) } ``` {% /tab %} {% tab label="REST" %} ```shell DOC_URL="https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf" PROMPT="Summarize this document" DISPLAY_NAME="base64_pdf" # Download the PDF wget -O "${DISPLAY_NAME}.pdf" "${DOC_URL}" # Check for FreeBSD base64 and set flags accordingly if [[ "$(base64 --version 2>&1)" = *"FreeBSD"* ]]; then B64FLAGS="--input" else B64FLAGS="-w0" fi # Base64 encode the PDF ENCODED_PDF=$(base64 $B64FLAGS "${DISPLAY_NAME}.pdf") # Generate content using the base64 encoded PDF curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent?key=$GOOGLE_API_KEY" \ -H 'Content-Type: application/json' \ -X POST \ -d '{ "contents": [{ "parts":[ {"inline_data": {"mime_type": "application/pdf", "data": "'"$ENCODED_PDF"'"}}, {"text": "'$PROMPT'"} ] }] }' 2> /dev/null > response.json cat response.json echo jq ".candidates[].content.parts[].text" response.json # Clean up the downloaded PDF rm "${DISPLAY_NAME}.pdf" ``` {% /tab %} {% /tabs %} You can also read a PDF from a local file for processing: {% tabs %} {% tab label="Python" %} ```python from google import genai from google.genai import types import pathlib client = genai.Client() # Retrieve and encode the PDF byte filepath = pathlib.Path('file.pdf') prompt = "Summarize this document" response = client.models.generate_content( model="gemini-3.8-flash", contents=[ types.Part.from_bytes( data=filepath.read_bytes(), mime_type='application/pdf', ), prompt]) print(response.text) ``` {% /tab %} {% tab label="JavaScript" %} ```javascript import { GoogleGenAI } from "@google/genai"; import * as fs from 'fs'; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(fs.readFileSync("content/343019_3_art_0_py4t4l_convrt.pdf")).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% tab label="Go" %} ```go package main import ( "context" "fmt" "os" "google.golang.org/genai" ) func main() { ctx := context.Background() client, _ := genai.NewClient(ctx, &genai.ClientConfig{ APIKey: os.Getenv("GEMINI_API_KEY"), Backend: genai.BackendGeminiAPI, }) pdfBytes, _ := os.ReadFile("path/to/your/file.pdf") parts := []*genai.Part{ &genai.Part{ InlineData: &genai.Blob{ MIMEType: "application/pdf", Data: pdfBytes, }, }, genai.NewPartFromText("Summarize this document"), } contents := []*genai.Content{ genai.NewContentFromParts(parts, genai.RoleUser), } result, _ := client.Models.GenerateContent( ctx, "gemini-3.8-flash", contents, nil, ) fmt.Println(result.Text()) } ``` {% /tab %} {% /tabs %} ## Uploading PDFs using the Files API {% id="large-pdfs" %} We recommend you use Files API for larger files or when you intend to reuse a document across multiple requests. This improves request latency and reduces bandwidth usage by decoupling the file upload from the model requests. {% callout type="note" %} The Files API is available at no cost in all regions where the Gemini API is available. Uploaded files are stored for 48 hours. {% /callout %} ### Large PDFs from URLs {% id="large-pdfs-urls" %} Use the File API to simplify uploading and processing large PDF files from URLs: {% tabs %} {% tab label="Python" %} ```python from google import genai from google.genai import types import io import httpx client = genai.Client() long_context_pdf_path = "https://www.nasa.gov/wp-content/uploads/static/history/alsj/a17/A17_FlightPlan.pdf" # Retrieve and upload the PDF using the File API doc_io = io.BytesIO(httpx.get(long_context_pdf_path).content) sample_doc = client.files.upload( # You can pass a path or a file-like object here file=doc_io, config=dict( mime_type='application/pdf') ) prompt = "Summarize this document" response = client.models.generate_content( model="gemini-3.8-flash", contents=[sample_doc, prompt]) print(response.text) ``` {% /tab %} {% tab label="JavaScript" %} ```javascript import { createPartFromUri, GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfBuffer = await fetch("https://www.nasa.gov/wp-content/uploads/static/history/alsj/a17/A17_FlightPlan.pdf") .then((response) => response.arrayBuffer()); const fileBlob = new Blob([pdfBuffer], { type: 'application/pdf' }); const file = await ai.files.upload({ file: fileBlob, config: { displayName: 'A17_FlightPlan.pdf', }, }); // Wait for the file to be processed. let getFile = await ai.files.get({ name: file.name }); while (getFile.state === 'PROCESSING') { getFile = await ai.files.get({ name: file.name }); console.log(`current file status: ${getFile.state}`); console.log('File is still processing, retrying in 5 seconds'); await new Promise((resolve) => { setTimeout(resolve, 5000); }); } if (file.state === 'FAILED') { throw new Error('File processing failed.'); } // Add the file to the contents. const content = [ 'Summarize this document', ]; if (file.uri && file.mimeType) { const fileContent = createPartFromUri(file.uri, file.mimeType); content.push(fileContent); } const response = await ai.models.generateContent({ model: 'gemini-3.8-flash', contents: content, }); console.log(response.text); } await main(); ``` {% /tab %} {% tab label="Go" %} ```go package main import ( "context" "fmt" "io" "net/http" "os" "google.golang.org/genai" ) func main() { ctx := context.Background() client, _ := genai.NewClient(ctx, &genai.ClientConfig{ APIKey: os.Getenv("GEMINI_API_KEY"), Backend: genai.BackendGeminiAPI, }) pdfURL := "https://www.nasa.gov/wp-content/uploads/static/history/alsj/a17/A17_FlightPlan.pdf" localPdfPath := "A17_FlightPlan_downloaded.pdf" respHttp, _ := http.Get(pdfURL) defer respHttp.Body.Close() outFile, _ := os.Create(localPdfPath) defer outFile.Close() _, _ = io.Copy(outFile, respHttp.Body) uploadConfig := &genai.UploadFileConfig{MIMEType: "application/pdf"} uploadedFile, _ := client.Files.UploadFromPath(ctx, localPdfPath, uploadConfig) promptParts := []*genai.Part{ genai.NewPartFromURI(uploadedFile.URI, uploadedFile.MIMEType), genai.NewPartFromText("Summarize this document"), } contents := []*genai.Content{ genai.NewContentFromParts(promptParts, genai.RoleUser), // Specify role } result, _ := client.Models.GenerateContent( ctx, "gemini-3.8-flash", contents, nil, ) fmt.Println(result.Text()) } ``` {% /tab %} {% tab label="REST" %} ```javascript import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfResp = await fetch('https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf') .then((response) => response.arrayBuffer()); const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(pdfResp).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% /tabs %} ### Large PDFs stored locally {% id="large-pdfs-local" %} {% tabs %} {% tab label="Python" %} ```javascript import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfResp = await fetch('https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf') .then((response) => response.arrayBuffer()); const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(pdfResp).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% tab label="JavaScript" %} ```javascript import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfResp = await fetch('https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf') .then((response) => response.arrayBuffer()); const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(pdfResp).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% tab label="Go" %} ```javascript import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfResp = await fetch('https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf') .then((response) => response.arrayBuffer()); const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(pdfResp).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% tab label="REST" %} ```javascript import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfResp = await fetch('https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf') .then((response) => response.arrayBuffer()); const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(pdfResp).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% /tabs %} You can verify the API successfully stored the uploaded file and get its metadata by calling [`files.get`](https://ai.google.dev/api/rest/v1beta/files/get). Only the `name` (and by extension, the `uri`) are unique. {% tabs %} {% tab label="Python" %} ```javascript import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfResp = await fetch('https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf') .then((response) => response.arrayBuffer()); const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(pdfResp).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% tab label="REST" %} ```javascript import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfResp = await fetch('https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf') .then((response) => response.arrayBuffer()); const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(pdfResp).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% /tabs %} ## Passing multiple PDFs {% id="prompt-multiple" %} The Gemini API is capable of processing multiple PDF documents (up to 1000 pages) in a single request, as long as the combined size of the documents and the text prompt stays within the model's context window. {% tabs %} {% tab label="Python" %} ```javascript import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfResp = await fetch('https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf') .then((response) => response.arrayBuffer()); const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(pdfResp).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% tab label="JavaScript" %} ```javascript import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfResp = await fetch('https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf') .then((response) => response.arrayBuffer()); const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(pdfResp).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% tab label="Go" %} ```javascript import { GoogleGenAI } from "@google/genai"; const ai = new GoogleGenAI({ apiKey: "GEMINI_API_KEY" }); async function main() { const pdfResp = await fetch('https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf') .then((response) => response.arrayBuffer()); const contents = [ { text: "Summarize this document" }, { inlineData: { mimeType: 'application/pdf', data: Buffer.from(pdfResp).toString("base64") } } ]; const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: contents }); console.log(response.text); } await main(); ``` {% /tab %} {% tab label="REST" %} ```go package main import ( "context" "fmt" "io" "net/http" "os" "google.golang.org/genai" ) func main() { ctx := context.Background() client, _ := genai.NewClient(ctx, &genai.ClientConfig{ APIKey: os.Getenv("GEMINI_API_KEY"), Backend: genai.BackendGeminiAPI, }) pdfResp, _ := http.Get("https://discovery.ucl.ac.uk/id/eprint/10089234/1/343019_3_art_0_py4t4l_convrt.pdf") var pdfBytes []byte if pdfResp != nil && pdfResp.Body != nil { pdfBytes, _ = io.ReadAll(pdfResp.Body) pdfResp.Body.Close() } parts := []*genai.Part{ &genai.Part{ InlineData: &genai.Blob{ MIMEType: "application/pdf", Data: pdfBytes, }, }, genai.NewPartFromText("Summarize this document"), } contents := []*genai.Content{ genai.NewContentFromParts(parts, genai.RoleUser), } result, _ := client.Models.GenerateContent( ctx, "gemini-3.8-flash", contents, nil, ) fmt.Println(result.Text()) } ``` {% /tab %} {% /tabs %} ## Office and OpenDocument files {% id="office-documents" %} Gemini models can process Microsoft Office and OpenDocument files. Pass them the same way as PDFs, either as `inlineData` or as `fileData` with the Files API, using one of the following MIME types: | File type | Extension | MIME type | | --- | --- | --- | | Documents | `.docx` | `application/vnd.openxmlformats-officedocument.wordprocessingml.document` | | | `.doc` | `application/msword` | | | `.dotx` | `application/vnd.openxmlformats-officedocument.wordprocessingml.template` | | | `.odt` | `application/vnd.oasis.opendocument.text` | | Presentations | `.pptx` | `application/vnd.openxmlformats-officedocument.presentationml.presentation` | | | `.ppt` | `application/vnd.ms-powerpoint` | | | `.odp` | `application/vnd.oasis.opendocument.presentation` | | Spreadsheets | `.xlsx` | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` | | | `.xls` | `application/vnd.ms-excel` | | | `.ods` | `application/vnd.oasis.opendocument.spreadsheet` | These files are processed as follows: * **DOCX, DOTX, ODT, and PPTX files**: The model receives the text of the whole file, plus embedded images for DOCX and PPTX files. Pages and slides aren't rendered as images, so page layout and visual elements such as charts might not be preserved. * **DOC, PPT, and ODP files**: Each page or slide is rendered as an image, so the model can interpret layouts, charts, and images. The whole file is processed. * **XLSX and XLS files**: Only the **first sheet** is read. Its contents are converted to CSV, so the model receives the cell values but not formulas or formatting. * **ODS files**: Only the **first sheet** is read. The model receives its cell data and formulas. Other sheets in a workbook are ignored. To analyze a different sheet, move it to the first position or save it as a separate file. Files are processed the same way whether you pass them in a request or a tool returns them in a [function response](/docs/function-calling#multimodal). The existing file size and page limits apply to the whole file. The following example uploads a PowerPoint presentation with the Files API and asks the model to summarize it: {% tabs %} {% tab filename="sample.py" label="Python" %} ```python from google import genai client = genai.Client() deck = client.files.upload( file="quarterly_review.pptx", config={ "mime_type": "application/vnd.openxmlformats-officedocument.presentationml.presentation" }, ) response = client.models.generate_content( model="gemini-3.8-flash", contents=[deck, "Summarize the key takeaways from each slide."], ) print(response.text) ``` {% /tab %} {% tab filename="sample.js" label="JavaScript" %} ```javascript import { GoogleGenAI, createUserContent, createPartFromUri, } from "@google/genai"; const ai = new GoogleGenAI({}); async function main() { const deck = await ai.files.upload({ file: "quarterly_review.pptx", config: { mimeType: "application/vnd.openxmlformats-officedocument.presentationml.presentation", }, }); const response = await ai.models.generateContent({ model: "gemini-3.8-flash", contents: createUserContent([ createPartFromUri(deck.uri, deck.mimeType), "Summarize the key takeaways from each slide.", ]), }); console.log(response.text); } main(); ``` {% /tab %} {% tab filename="sample.sh" label="REST" %} ```shell curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent" \ -H "x-goog-api-key: $GEMINI_API_KEY" \ -H 'Content-Type: application/json' \ -X POST \ -d '{ "contents": [{ "parts": [ { "fileData": { "fileUri": "https://generativelanguage.googleapis.com/v1beta/files/FILE_ID", "mimeType": "application/vnd.openxmlformats-officedocument.presentationml.presentation" } }, {"text": "Summarize the key takeaways from each slide."} ] }] }' ``` {% /tab %} {% /tabs %} Tools can also return these files to the model. For details, see [Multimodal function responses](/docs/function-calling#multimodal). ## Technical details {% id="technical-details" %} Gemini supports PDF files up to 50MB or 1000 pages. This limit applies to both inline data and Files API uploads. Each document page is equivalent to 258 tokens. While there are no specific limits to the number of pixels in a document besides the model's [context window](/docs/long-context), larger pages are scaled down to a maximum resolution of 3072 x 3072 while preserving their original aspect ratio, while smaller pages are scaled up to 768 x 768 pixels. There is no cost reduction for pages at lower sizes, other than bandwidth, or performance improvement for pages at higher resolution. ### Gemini 3 models {% id="gemini-3-models" %} Gemini 3 introduces granular control over multimodal vision processing with the `media_resolution` parameter. You can now set the resolution to low, medium, or high per individual media part. With this addition, the processing of PDF documents has been updated: 1. **Native text inclusion:** Text natively embedded in the PDF is extracted and provided to the model. 2. **Billing & token reporting:** * You are **not charged** for tokens originating from the extracted **native text** in PDFs. * In the `usage_metadata` section of the API response, tokens generated from processing PDF pages (as images) are now counted under the `IMAGE` modality, not a separate `DOCUMENT` modality as in some earlier versions. For more details about the media resolution parameter, see the [Media resolution](/docs/media-resolution) guide. ### Document types {% id="document-types" %} Document vision meaningfully understands PDFs and DOC, PPT, and ODP files, which are rendered as page images. DOCX, DOTX, ODT, and PPTX files are converted to text, and spreadsheets are read as tabular data. For details, see [Office and OpenDocument files](/docs/document-processing#office-documents). Technically, you can pass other MIME types for document understanding, like TXT, Markdown, HTML, XML, etc. However, these types are extracted as pure text, which means the model can't understand the visual elements present in a rendered file. Any file-type specifics like charts, diagrams, HTML tags, Markdown formatting, etc., will be lost. To learn about other file input methods, see the [File input methods](/docs/file-input-methods) guide. ### Best practices {% id="best-practices" %} For best results: * Rotate pages to the correct orientation before uploading. * Avoid blurry pages. * If using a single page, place the text prompt after the page. ## What's next {% id="whats-next" %} To learn more, see the following resources: * [File prompting strategies](/docs/files#prompt-guide): The Gemini API supports prompting with text, image, audio, and video data, also known as multimodal prompting. * [System instructions](/docs/text-generation#system-instructions): System instructions let you steer the behavior of the model based on your specific needs and use cases.