How to Edit PDFs and Code Inside Gemini

How to Edit PDFs and Code Inside Gemini

Gemini can create and edit files inside a conversation. You can use it for PDFs, documents, spreadsheets, presentations, and code.

What Gemini Can Edit

Google added file preview and editing features to the Gemini app on October 29, 2026. The feature supports generated files and uploaded content. Google says all users can access it in supported Gemini languages.

PDF preview and editing work on the web and mobile apps. Other supported formats work on the web. These include Google Docs, Google Sheets, slide decks, Markdown, plain text, and code.

Gemini can create many file types. Supported formats include PDF, DOCX, XLSX, CSV, PPTX, Markdown, JSON, and common programming files. The official Gemini help page lists code formats such as Python, JavaScript, TypeScript, Java, Go, Rust, SQL, and Swift.

Create Your First File

  1. Open Gemini in a web browser or mobile app. Use the web version for non-PDF files.
  2. Ask Gemini to create a specific file. Name the format and explain the intended audience.
  3. Review the generated file in the conversation. Open the preview when Gemini provides one.
  4. Ask for focused changes. Mention the section, field, or function that needs revision.
  5. Download the finished file or export it to Google Drive.

Specific prompts produce more useful results. Try this example: “Create a two-page PDF study guide about basic networking. Include a glossary and five review questions.”

For code, identify the language and expected behavior. For example: “Create a Python script that reads a CSV file and reports missing values. Explain the output briefly.”

Revise Files in Context

Gemini lets you continue editing from the same chat. You can highlight text and ask for a change. You can also type a request in the file editor.

Useful requests include “replace the introduction,” “turn this table into a chart,” and “add comments to this function.” Keep each request narrow. Smaller changes are easier to review.

When a file contains data, explain the desired structure. State the column names, sorting order, and calculation rules. Gemini can then create a cleaner spreadsheet or report.

For code, ask Gemini to show the changed section and explain the reason. Then compare the result with the original file. Review generated code before using it in a real project.

Know the Device Limits

The web version offers the broadest editing experience. Google supports direct editing for more file types on the web than on mobile.

On mobile, PDF editing is supported. Direct editing for Markdown and plain-text files is not currently available. Instead, ask Gemini to revise those files and create a new version.

Gemini can export Markdown and plain text files from Canvas. Canvas is Gemini’s editing workspace for text and markup. The official task documentation describes the available export options.

Review Before You Share

Check every important file before using it. Gemini may misunderstand a source, change a value, or invent supporting details.

Review calculations in spreadsheets. Check citations in reports. Test code before using it in a real project.

Avoid uploading passwords, payment details, private keys, or confidential records. Google advises users not to enter sign-in information or payment details directly into a task thread.

For work involving private data, confirm your organization’s AI policy first. Also check who can access the exported file in Google Drive.

References

Google. (2026, October 29). Edit and preview documents directly in Gemini. Google Blog. https://blog.google/innovation-and-ai/products/gemini-app/edit-files-directly/

Google. (n.d.). Use Gemini Apps. Google Gemini Apps Help. Retrieved November 26, 2026, from https://support.google.com/gemini/answer/13275745

Google. (n.d.). Manage your tasks and workflows in Gemini Apps. Google Gemini Apps Help. Retrieved November 26, 2026, from https://support.google.com/gemini/answer/17094507