# Servoy PDF Viewer

Welcome to **svyPDFViewer**!

This wiki provides comprehensive documentation for using the **svyPDFViewer** web-component, which makes viewing PDF documents in Servoy's NGClient easy and intuitive.

{% hint style="info" %}
*<mark style="color:blue;">**Content under construction**</mark>*
{% endhint %}

## Getting Started

It's easy to get started. Simply import the [web package](https://github.com/Servoy/svyPDFViewer/releases/download/v1.1.0/pdfviewer.zip) via Servoy's Web Package Manager.

If you like to see a sample, install the example solution, \[**svyPDFViewerExample.servoy**] (<https://github.com/Servoy/svyPDFViewer/releases/download/v1.1.0/svyPDFViewerExample.servoy>)

### Example Usage

Load document using **absolute** URL

```javascript
elements.pdfViewer.documentURL = 'http://www.cbu.edu.zm/downloads/pdf-sample.pdf';
```

Load document using URL which is **relative** to the web application's root context. For example:

* <http://my-host:8080/myApplication/reports/test.pdf> - this would be in production server
* <http://localhost:8080/reports/test.pdf> - this would be in developer

```javascript
elements.pdfViewer.documentURL = 'reports/test.pdf'; 
```

## Servoy PDF Viewer properties

Servoy PDF Viewer properties can be found [here](https://github.com/Servoy/gitbook/blob/master/guides/develop/application-design/ui-components/specialized-components/svypdfviewer/broken-reference/README.md).

### [reload](https://github.com/Servoy/gitbook/blob/master/guides/develop/application-design/ui-components/specialized-components/svypdfviewer/broken-reference/README.md)

Reloads the document. Use in combination with [noCache](#nocache). Call this method when document has changed on the server.

### [noCache](https://github.com/Servoy/gitbook/blob/master/guides/develop/application-design/ui-components/specialized-components/svypdfviewer/broken-reference/README.md)

Indicates if caching should be disabled. Set to true when PDF might change on the server.

### [documentURL](https://github.com/Servoy/gitbook/blob/master/guides/develop/application-design/ui-components/specialized-components/svypdfviewer/broken-reference/README.md)

The URL of the PDF document. Can be absolute or relative.

## Servoy PDF Viewer API

Servoy PDF Viewer API methods can be found [here](https://github.com/Servoy/gitbook/blob/master/guides/develop/application-design/ui-components/specialized-components/svypdfviewer/broken-reference/README.md).


---

# Agent Instructions: 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:

```
GET https://docs.servoy.com/guides/develop/application-design/ui-components/specialized-components/home-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
