> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revoengine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# storage.getDocument()

> Public low-code contract, signatures and examples for storage.getDocument.

## `storage.getDocument()`

Reads bounded text, JSON, XML, or PDF/DOCX text from Storage. PDF/DOCX
extraction is text-only, capped at 40,000 characters and 100 PDF pages,
with explicit extraction/truncation and possible-OCR metadata. Source input
is limited to 10 MiB; use getFileData for XLSX or record-oriented files.

`format: 'text'` is the default and supports optional byte ranges.
For text line windows pass startLine/endLine/maxChars; the result contains
line metadata instead of byte offsets. Do not mix line and byte ranges.
`format: 'json'` returns `document` from JSON.parse; `format: 'xml'`
returns an order-preserving XML representation. `format: 'auto'` selects
JSON/XML from the stored MIME type or file extension.

### Overloads

```ts theme={null}
static getDocument(
      storageEntryId: string,
      options?: StorageDocumentReadOptions,
    ): Promise<StorageDocument>;

static getDocument(
      namespace: string,
      storageEntryId: string,
      options?: StorageDocumentReadOptions,
    ): Promise<StorageDocument>;
```

### Example

```ts theme={null}
const doc = await storage.getDocument(storageEntryId, { format: 'auto' });
return doc.document ?? doc.content;
```

See [all storage methods](https://docs.revoengine.com/low-code/reference/storage.md) or [runtime basics](https://docs.revoengine.com/low-code/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.