> 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/get-started/faq/loading-errors.md).

# Troubleshoot WebViewer Loading Errors

World's #1 PDF SDK Library for Web, Mobile, Server, Desktop

## GET /ui/index.html 404 (Not Found)

Try adjusting the `path` option in the PDFTron.WebViewer constructor so that it points to the location of your lib folder.

## Invalid XOD file, signature is wrong

If you're trying to load a PDF document and the URL doesn't have an extension you might get this error. You can let WebViewer know that it should treat this file as a PDF by passing the option `documentType: 'pdf'` to the `PDFTron.WebViewer` constructor.

## Not allowed to load local resource: file:///...

Note because of browser security restrictions you will not be able to run WebViewer from the file system. Instead you can [run it from a local server](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server/), or use the [WebViewer integrated server](/web/webviewer-server/wv-server-deployment.md).

## Failed to load document. The document is either corrupt or not a valid PDF document.

If you are trying to load a PDF file then you should try opening the document in another PDF viewer to confirm that it loads. If it doesn't load in any other viewers then your PDF file may be corrupt or invalid.

This error may also occur if you're loading a XOD document but WebViewer thinks you want to load a PDF. By default WebViewer will look at the extension of the path that you pass to initial doc and if it ends in .pdf it will treat the document as a PDF. You may see an error that looks like:

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

```sh
Error: Exception:
   Message: Header not found
   Filename:
   Function: SkipHeader
   Linenumber:
```

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

If your file path looks something like `myserver.com/conversion-to-xod.asp?doc=GettingStarted.pdf` then WebViewer will treat it as a PDF file because of the extension at the end. To override this you can pass the option `documentType: 'xod'` to the WebViewer constructor. This will force WebViewer to treat the document as a XOD file.

## Invalid XOD file: Zip end header data is wrong size!

This error usually means that your server does not support HTTP range requests properly. Instead of downloading a small part of the file it is downloading the entire file.

If you're serving your files statically from your server usually range requests will just work, however if you have your own endpoint for the file there are libraries that can handle range requests for you, or you could [implement it support yourself](https://tools.ietf.org/html/rfc7233#section-2.1).

As a last resort you can set the streaming option in the WebViewer constructor to true. This is intended for streaming of the XOD conversion but can be used as a workaround for servers that don't support range requests at the cost of reduced performance and increased memory usage. See [this guide](/web/best-practices/streaming-option.md) for more information.

## getComputedStyle(...) is null

You might get this error in Firefox (alternately `NS_ERROR_FAILURE` or "memory access out of bounds") if you initially have the element that contains WebViewer set to `display: none`. You can follow the Firefox bug tracking this issue here <https://bugzilla.mozilla.org/show_bug.cgi?id=548397>.

To work around this bug you can instead set the element to `visibility: hidden` or `height: 0; width: 0;`.

## The XOD file version is too new for this client

If you update the version of PDFNet you're using to generate XOD files you might receive this error, as the XOD files may not be compatible with your WebViewer version. To fix this, you can update WebViewer to the latest version or you can use the "silverlight/flash compatible" option when generating XOD files.

The reason it is called "silverlight/flash compatible" is because these XOD files work with older versions of WebViewer that used Silverlight and Flash, but these older XOD files will also work with older (but not that old) WebViewer clients so you can avoid updating your WebViewer client even after updating the version of PDFNet that you use to convert to XOD. You can read more about [using Silverlight Flash compatibility](https://sdk.apryse.com/api/PDFTronSDK/java/com/pdftron/pdf/Convert.XODOutputOptions.html#UseSilverlightFlashCompatible\(boolean\)).


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/web/get-started/faq/loading-errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
