# File Viewers

Preview everything without leaving Treasure AI Studio. Built-in viewers render PDFs, spreadsheets, presentations, code, and more, so you can inspect an AI-generated report or an uploaded document the moment it exists — no download, no switching applications. Every viewer is read-only: it shows you a file, and you change that file by asking the AI in chat.

Files open as tabs in the artifacts panel beside the chat, or full-width from a work folder page. Which viewer renders a file is decided by its extension alone, and every extension resolves to something — an unrecognized one falls back to plain text, so no file is ever unopenable.

Note
File viewers render content client-side from server-stored files. The AI does not re-process a file when you open it in a viewer — it's a direct render of the file's contents.

## Objective

Open and interact with files generated by the AI or uploaded by you, using the appropriate built-in viewer for each file type.

## Prerequisites

- Signed in to Treasure AI Studio ([Getting Started](/products/ai-studio/getting-started))
- A file in the current chat or work folder (uploaded or AI-generated)


## Supported Viewers

Treasure AI Studio selects a viewer from the file extension. Extensions not listed below open in the Plain Text viewer.

| Viewer  | Extensions  | Key Features  |
|  --- | --- | --- |
| **PDF** | `pdf` | Continuous vertical scroll, zoom 50–300%, page counter |
| **Spreadsheet** | `xlsx`, `csv`, `tsv` | Table with a header row; sheet tabs for multi-sheet XLSX workbooks |
| **Presentation** | `pptx` | All slides rendered as vector graphics, scrolled top to bottom |
| **Document** | `docx`, `doc` | Rendered page layout preserving headings, tables, and styling |
| **Image** | `png`, `jpg`, `jpeg`, `gif`, `svg`, `webp`, `bmp`, `ico` | Scaled to fit, original aspect ratio preserved |
| **Code** | `js`, `jsx`, `ts`, `tsx`, `py`, `rb`, `go`, `rs`, `java`, `c`, `cpp`, `h`, `sh`, `bash`, `sql`, `yaml`, `yml`, `json`, `xml`, `css`, `scss`, `toml` | Syntax highlighting, line numbers, theme-aware |
| **Markdown** | `md`, `markdown` | Rendered Markdown — the same renderer used for AI responses in chat |
| **HTML** | `html`, `htm` | Rendered in a sandboxed iframe with scripts enabled |
| **Journey** | `*.journey.yaml`, `*.journey.yml` | Flow diagram of a journey definition's stages and steps, with per-step configuration |
| **Mermaid** | `mmd`, `mermaid` | Rendered diagrams, theme-aware |
| **Plain Text** | `txt`, `log`, and every unrecognized extension | Monospace, pre-formatted, with line numbers |


Legacy Office formats
The **`.ppt`** and **`.xls`** binary formats predate the Open XML formats and are not rendered. A `.ppt` file opens in the Plain Text viewer, and an `.xls` file opens in the Spreadsheet viewer but does not parse as a workbook. Convert to `.pptx` or `.xlsx` before uploading, or download the file and open it in PowerPoint or Excel. Note that the *icon* Studio shows for these files still marks them as a presentation and a spreadsheet — the icon reflects the category, not whether a viewer exists.

## PDF Viewer

The PDF viewer renders every page of a document in one continuously scrolling column, with zoom controls and a page counter in the toolbar.

### Controls

| Control  | Description  |
|  --- | --- |
| **Page counter** | Shows the current page and the total as **`3 / 12`**, at the left of the toolbar. It updates as you scroll, tracking the most visible page |
| **Zoom out** / **Zoom in** | Change the zoom level in 25% steps. Each button disables at its limit — 50% for zoom out, 300% for zoom in |
| **Zoom percentage** | Displays the current zoom level between the two zoom buttons. Select it to return to 100%; it is disabled while already at 100% |


### Navigation

Scroll vertically through the document. There are no page-jump controls and no keyboard shortcuts — the page counter is a readout, not an input.

### Tips for PDFs

- **Text-based PDFs** (natively digital) render most reliably. Scanned documents may work but with reduced quality.
- **Password-protected PDFs** cannot be rendered. Remove protection before uploading.
- **Large PDFs** consume significant context when the AI processes them. For documents over 50 pages, consider uploading only the relevant section.


Technical Note
The PDF viewer uses `react-pdf` with a locally bundled PDF.js worker. Pages render on-canvas, with an IntersectionObserver tracking the most visible page for the counter. The zoom range is 0.5x to 3.0x in 0.25x increments.

## Spreadsheet Viewer

The spreadsheet viewer displays tabular data as an HTML table, treating the first row of each sheet as the header row.

### Features

| Feature  | Description  |
|  --- | --- |
| **Sheet tabs** | For XLSX workbooks, tabs appear at the bottom, one per sheet. Select a tab to switch sheets |
| **Header row** | The first row of every sheet renders as a shaded header. A file with no header row shows its first data row as one |
| **Scrolling** | Horizontal and vertical scroll for large datasets. Cells do not wrap, so wide columns extend the table rather than growing taller |


CSV and TSV files render as a single table with no sheet tabs — those formats hold one sheet by definition. The separator is chosen by extension: `.tsv` splits on tabs, `.csv` on commas.

Note
The spreadsheet viewer does not sort, filter, resize, or edit. It is a faithful read-only rendering of the file. To reorganize the data, ask the AI to do it and regenerate the file, or download the file and open it in Excel.

## Presentation Viewer

The presentation viewer converts a PPTX file into vector graphics and stacks every slide in one vertically scrolling column, each at the deck's original aspect ratio. Scroll to move through the deck.

Artifacts panel with a PPTX file open: one tab named treasure_ai_2026.pptx, delete, download, maximize and close actions in the header, and the deck's slides rendered one below another in a single vertical scrolling column — no thumbnail sidebar, no slide counter, no speaker notes pane
Conversion happens in the browser and preserves the deck's theme, per-slide layouts, and slide dimensions. Speaker notes are not rendered — download the file to read them.

Note
The presentation viewer has no slide thumbnails, no keyboard navigation, and no slide counter. It renders a deck for review, not for presenting. For pixel-perfect rendering or presenter mode, download the file and open it in PowerPoint.

## Document Viewer

The document viewer renders DOCX and DOC files as laid-out pages on a shaded background, preserving headings, paragraphs, lists, tables, and basic styling from the original document.

Document pages always render on a white background, whatever your Studio appearance setting — the viewer reproduces the document's own page styling rather than restyling it for dark mode.

## Image Viewer

Images display scaled to fit within the viewer area while maintaining their original aspect ratio. Supported formats are PNG, JPG, JPEG, GIF (including animated), SVG, WebP, BMP, and ICO. The image viewer has no zoom or pan controls; use **Maximize** to give a detailed image more room.

## Code Viewer

The code viewer provides syntax-highlighted, read-only display of source code files with line numbers. It is deliberately read-only: you change a file by asking the AI in chat, not by editing it in the viewer.

### Supported Languages

Syntax highlighting is applied for JavaScript and TypeScript (including JSX/TSX), Python, Ruby, Go, Rust, Java, C, C++, shell and Bash scripts, SQL, YAML, JSON, XML, CSS, SCSS, and TOML. The language is detected from the file extension; an extension with no mapping still renders with line numbers, just without highlighting.

Both light and dark themes are supported, matching your Studio appearance setting.

## Markdown Viewer

Markdown files (`.md`, `.markdown`) render as formatted content with headings, lists, code blocks, links, tables, and other standard Markdown elements — the same renderer used for AI responses in chat.

## HTML Viewer

HTML files render inside a **sandboxed iframe**. Scripts are allowed to run, so AI-generated dashboards and interactive reports work as intended, but the sandbox withholds same-origin access, form submission, navigation, and popups, and the frame sends no referrer. An HTML file cannot reach your Studio session, your account, or the page around it.

On **Desktop**, Studio serves the HTML from a separate internal origin rather than embedding it inline. This exists so that scripts in an HTML file are not blocked by the desktop shell's own content security policy — the practical result is that interactive HTML renders the same on Desktop as it does on the Web.

## Journey Viewer

Journey definitions named `.journey.yaml` or `.journey.yml` render as a flow diagram inside a sandboxed frame, adapting to your light or dark appearance setting: stages run left to right, branches stack below the decisions that create them, and the steps carry the shapes and colors used by [Journey Orchestration](/products/customer-data-platform/journey-orchestration).

The **`.journey` part of the name is what selects this viewer**, and Studio needs it: journey definitions are YAML, and nothing about the contents of a `.yaml` file tells Studio to draw a diagram rather than show you the source. So a journey named `welcome-series.yaml` opens in the [code viewer](#code-viewer), and the same file renamed `welcome-series.journey.yaml` opens as a diagram. The AI does not always apply the suffix — if you get syntax-highlighted YAML where you expected a diagram, ask it to rename the file. The `tdx` CLI follows the same convention: `tdx journey pull` writes `*.journey.yml`.

Selecting a step opens its configuration, but only where there is configuration to show — an **activation** step (its connection, connector config, and how many columns it sends), a **wait** step (the segment that ends the wait early, and the timeout), an **entry** node, a stage's criteria badges, and a branch badge that references a segment. Decision point, merge, jump, and end steps have nothing behind them and do not respond.

The diagram is read-only and renders **the file**, not a running journey: it shows what the definition says will happen, with none of the live profile counts that [Journey Canvas Statistics](/products/customer-data-platform/journey-orchestration/journey-canvas-statistics) reports for a launched journey. For what the steps and criteria mean, see [Journey Orchestration](/products/customer-data-platform/journey-orchestration); for the YAML schema and the commands that validate and push a journey, see [`tdx journey`](/treasure-code/commands/journey).

## Mermaid Viewer

Mermaid diagram files (`.mmd`, `.mermaid`) render as visual diagrams — flowcharts, sequence diagrams, class diagrams, and other Mermaid-supported types. The viewer adapts to your current theme, and diagrams wider than the panel scroll horizontally.

Mermaid runs in its strict security mode, so diagram definitions cannot inject HTML or scripts into Studio.

## Plain Text Viewer

Files with `.txt`, `.log`, or any unrecognized extension display as pre-formatted monospace text with line numbers. This is the fallback viewer, which is what guarantees that every file in Studio can be opened.

## Maximize

Select **Maximize artifact** (the expand icon) in the panel header to open the active file in a near-full-screen overlay with the same viewer and the file name in its header. Select **Close maximized artifact** (the collapse icon) or press **Escape** to return to the panel.

The other actions in the panel header — download and delete — are documented in [The File Viewer Panel](/products/ai-studio/files/file-upload-download#the-file-viewer-panel).

## Viewer Errors

Every viewer reports failure in place, with the file left open so you can retry or download it. The messages are:

| Message  | What It Means  |
|  --- | --- |
| **"Error loading content"** | The file could not be fetched from the server. Usually transient — reload the file tree and open it again |
| **"No content available"** | The file was fetched but is empty |
| **"Error parsing spreadsheet"** | The workbook could not be read. Most often a `.xls` file or a corrupted `.xlsx` |
| **"Error parsing presentation"** | The PPTX could not be converted. Download the file and open it in PowerPoint to check whether the file itself is intact |
| **"Error parsing journey file"** | The journey YAML is not valid against the journey schema. Ask the AI to run `tdx journey validate` on it |
| **"No journey stages found"** | The journey file parsed but defines no stages, which usually means it is only half-written. This message is in English in the Japanese interface too |
| **"Error parsing Mermaid diagram"** | The diagram definition has a syntax error. Ask the AI to fix the diagram source |


While a file is being fetched or converted, the viewer shows a status message naming what it is doing — for example **"Loading PDF..."** then **"Parsing PDF..."**, or **"Parsing presentation..."**. Large files spend a visible moment in the parsing state; that is expected, not a failure.

## Mobile Viewers

On Mobile, tapping a file card opens a preview with the following considerations:

- **Supported formats** — images (PNG, JPG, GIF, WebP, BMP; not SVG), code, HTML, Markdown, Mermaid diagrams, journey files (`*.journey.yaml`), PDF (with a page indicator), DOCX, XLSX/XLS/CSV/TSV (shown as a spreadsheet table), and PPTX. Any other file shows "This file can't be previewed."
- **Large files** are truncated for performance, with a notice: "Preview truncated — file too large to show in full."
- **HTML files** render in a WebView
- **Segment files** have no visual segment viewer on Mobile; the YAML is shown as code


Technical Note
Mobile previews truncate file content at 100,000 characters or 5,000 lines, whichever comes first. Mobile does not offer file download.

## Verification

- [ ] Click a file in the sidebar file tree and see it render in the appropriate viewer
- [ ] Zoom in on a PDF and see the page counter update as you scroll
- [ ] Switch sheets in a multi-sheet XLSX workbook using the tabs at the bottom
- [ ] Maximize a file and return to the panel with **Escape**


## Troubleshooting

| Issue  | Solution  |
|  --- | --- |
| "Error loading content" | The file may still be uploading, or the server may be temporarily unavailable. Use **Refresh files** on the work folder in the sidebar to reload the tree from the server, then open the file again |
| PDF pages render blank | Large PDFs take time to rasterize. Wait for the loading indicator to finish. If pages stay blank, the PDF may be password-protected — remove the protection and re-upload |
| A spreadsheet or deck fails to parse | Check the extension: `.xls` and `.ppt` are not supported. Convert to `.xlsx` or `.pptx`, or download the file and open it in Excel or PowerPoint |
| Columns are cut off in a spreadsheet | Cells do not wrap and columns cannot be resized. Scroll horizontally, or ask the AI to regenerate the file with shorter column values |
| A `.yaml` journey file opens as code | The journey viewer is selected by the `.journey.yaml` or `.journey.yml` suffix. Rename the file to include `.journey` before the extension |
| An HTML report looks broken | The sandbox blocks navigation, form submission, and popups, and external resources still need network access. Ask the AI to inline the assets the report depends on |


## Next Steps

- [File Upload & Download](/products/ai-studio/files/file-upload-download) — Upload files, download outputs, and organize a work folder
- [AI-Generated Files](/products/ai-studio/files/artifacts) — Ask the AI to produce PPTX, DOCX, PDF, and XLSX deliverables
- [AI Chat Interface](/products/ai-studio/chat/chat) — Working with file context in conversations