> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/open-save-document/open/blob.md).

# Open and Load Blob Format Documents Using JavaScript

Easily open blob format documents in WebViewer. The Apryse Web SDK streamlines secure, serverless document processing with robust support for JavaScript and TypeScript, and seamlessly integrates with

## Opening a document in WebViewer from Blob

If your document is already in [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob/) format you can pass the Blob object directly to loadDocument function.

{% tabs %}
{% tab title="JavaScript (SDK v8.0+)" %}
{% code lineNumbers="true" %}

```js
WebViewer(...)
  .then(instance => {
    // `myBlob` is your blob data which can come
    // from sources such as a server or the filesystem
    instance.UI.loadDocument(myBlob, { filename: 'myfile.pdf' });

    const { documentViewer } = instance.Core;
    documentViewer.addEventListener('documentLoaded', () => {
      // perform document operations
    });
  });
```

{% endcode %}

[UI.loadDocument](https://sdk.apryse.com/api/web/UI.html#.loadDocument__anchor)
{% endtab %}

{% tab title="JavaScript (SDK v6.0+)" %}
{% code lineNumbers="true" %}

```js
WebViewer(...)
  .then(instance => {
    // `myBlob` is your blob data which can come
    // from sources such as a server or the filesystem
    instance.loadDocument(myBlob, { filename: 'myfile.pdf' });

    const { docViewer } = instance;
    docViewer.on('documentLoaded', () => {
      // perform document operations
    });
  });
```

{% endcode %}

[WebViewerInstance.loadDocument](https://sdk.apryse.com/api/web/UI.html#loadDocument__anchor)
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
If you are loading from a blob, please ensure the [extension](/web/open-save-document/open.md#the-extension-option) or [filename](/web/open-save-document/open.md#the-filename-option) options are set while loading.
{% endhint %}

## Loading Options

WebViewer provides various options to load a document. Whether you are loading a document through the `initialDoc` option in the constructor or calling `loadDocument` after mounting, you can always provide [options to load your document](/web/open-save-document/open.md#loading-options).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.apryse.com/web/open-save-document/open/blob.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
