# PDFViewer
> AstrolPDFViewer is a highly efficient and customizable Blazor component for PDF visualization, offering both traditional and modern options with great configurability and lightweight design.
Source page: https://doc.astrolui.com/pdf-viewer/pdf-viewer-component
## 1. Demo AstrolPDFViewer
The following buttons **are not part** of the component.
**They are for you to test some visual parameters of the component:**
- **Style** (modern or traditional)
- **Mode** (display all pages at once or one by one)
- **Outline** (dark or light)
```razor
@using Astrol.Component.PDFViewer
@using Astrol.Component.PDFViewer.Helper
```
### Supported parameters
- StylePDFViewer** (StylePDFViewer)**, component style **(default is StylePDFViewer.Modern)**: **Traditional** or **Modern**.
- Outline** (bool)**, controls with a border only, no shadow; colors follow the theme and the light or dark mode **(default is false)**.
- PdfBytes** (byte[]?)**, PDF file as a byte array **(takes precedence over PdfUrlOrPath)**.
- PdfUrlOrPath** (string?)**, URL or path within the app to the PDF file. If it is on another domain, the server must allow **CORS**.
- **A PdfBytes or a PdfUrlOrPath must be set**; changing them opens the document again.
- PresentationMode** (bool)**, shows all pages or one at a time **(default is false)**.
- StartPage** (int)**, starting page **(default is 1)**.
- Scale** (float)**, page size, from **0.25 to 10(default is 1.5F)**.
- Deg** (int)**, page rotation: -270, -180, -90, 0, 90, 180 or 270 **(default is 0)**.
- Load** (RenderFragment)**, custom loading indicator (a spinner by default).
- EnablePagination, EnableRotation, EnableZoom, EnableFullScreen, EnableDownload** (bool)**, show each group of options **(default true)**.
- DocumentNameToDownload** (string)**, file name when downloading **(default DOC (year-month-day).pdf)**. The download uses the document already open, without requesting it from the server again.
- OnPageChange** (EventCallback)**, raised when the page changes with the buttons, the keyboard or **GoToPageAsync**.
- OnScaleChange** (EventCallback)**, raised when the zoom changes.
- OnDegChange** (EventCallback)**, raised when the pages are rotated.
- OnError** (EventCallback)**, raised when the PDF cannot be opened (unreachable URL, CORS or damaged file); the viewer shows a notice.
- Performance: only visible pages (± 400 px) are rendered and far pages release their memory; pages look sharp on high-density screens.
- Keyboard: with the document area focused, **up/down arrows**, **Page Up/Down** and **space** scroll; **left/right** change the page; **Home/End** go to the first/last page. All controls are buttons with an accessible name.
- **Signature** (each viewer is independent) and **IconLoad** (use **Load**) were removed because they had no effect: delete them from your code when upgrading.
### Public methods
- They are used using **@ref** in the **AstrolPDFViewer** component. Example ****, declare **_pdfViewer** inside **@code { private AstrolPDFViewer? _pdfViewer; }**.
- **RefreshAsync**, allows you to refresh the component, especially if the document to be displayed has changed and you need the component to update it without the need for partial or total reload of it or the page.
- **GoToPageAsync** (receives an int), allows you to change the page.
- **GetCurrentPage**, allows you to obtain the current page.
- **GetTotalPage**, allows you to obtain the number of pages of the component.
- **GetCurrentScale**, allows you to obtain the current scale.
- **GetCurrentDeg**, allows you to obtain the current orientation degs.