> 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/best-practices/usedownloader-option.md).

# Streaming PDF Documents using JavaScript

Streamline PDF document streaming with JavaScript using the "Downloader" feature for efficient fetching of linearized files. Learn how to enable, disable, and requirements for optimal performance. The

{% hint style="info" %}
The **useDownloader option** is only applicable when loading PDF files. If you're loading XOD files then please go to [Streaming XOD documents ](/web/best-practices/streaming-option.md).
{% endhint %}

"Downloader" is a streaming feature of [client only mode](/web/what-is-webviewer/deployment-options.md#client-only) which allows it to efficiently fetch PDF files that have been linearized. The PDF spec describes linearization as a feature "that enables efficient incremental access of the file in a network environment."

By default downloader is enabled which allows WebViewer to quickly display the initial page in the document and download remaining pages incrementally for large linearized files.

{% hint style="info" %}
**Requirements for downloader to work**

* The PDF files are linearized. You can use [a native Apryse library](/core/get-started/readme.md) to linearize files.
* Byte range requests supported on your server. This should usually just work when serving your documents statically but you may need to use a library if you're serving them in a different way.
  {% endhint %}

## Disabling downloader

Generally it is **not** recommended to disable downloader because of the improved performance when loading linearized documents. It is only advisable if your server doesn't support byte range requests and you aren't able to enable them for some reason.

You also need to disable it if you are using [`doc.insertBlankPages`](https://sdk.apryse.com/api/web/Core.Document.html#insertBlankPages__anchor).

You can disable downloader as follows:

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
WebViewer({
  initialDoc: "GettingStarted.pdf",
  useDownloader: false
}, viewerElement);
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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/best-practices/usedownloader-option.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.
