Home
PERENDERnew
Theme
Form
Basic components
PDF viewer
chartsnew
Installation
line
File browser
Rich text
PDF viewer
PDFViewer
PDFViewer

1. Demo AstrolPDFViewer

Note
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)
14
@using Astrol.Component.PDFViewer
@using Astrol.Component.PDFViewer.Helper
<div style="height:600px; width:calc(100% - 10px); float:left; margin:10px 5px;">
 <AstrolPDFViewer Signature="D1" PdfUrlOrPath="https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf" />
</div>

Supported parameters

  • Signature (string), component signature, must be unique for each instance of the AstrolPDFViewer component throughout the application.
  • StylePDFViewer (StylePDFViewer), component style (default is StylePDFViewer.Modern).
    • Traditional (enum)
    • Modern (enum)
  • Outline (bool), whether it should have no fill (default is false).
  • PdfBytes (byte[]?), PDF file as a byte array, (not required, takes precedence over the PdfUrlOrPath parameter).
  • PdfUrlOrPath (string?), URL or path within the application to the PDF file, (not required).
  • A PdfBytes or a PdfUrlOrPath must be set
  • PresentationMode (bool), sets the mode of presenting the PDF, all pages or one by one (default is false).
  • StartPage (int), starting page (default is 1).
  • Scale (float), display size of the pages, supports values from 0.25 to 20 (default is 1.5F).
  • Deg (int), orientation or rotation degrees of the pages, supports the following values (-270, -180, -90, 0, 90, 180, 270) (default is 0, vertical orientation).
  • IconLoad (string), loading icon (default is astrol-spin5).
  • EnablePagination (bool), show pagination options and information (default is true).
  • EnableRotation (bool), show rotation options (default is true).
  • EnableZoom (bool), show zoom options (default is true).
  • EnableFullScreen (bool), show fullscreen option (default is true).
  • EnableDownload (bool), show download option (default is true).
  • DocumentNameToDownload (string), allows setting a title for the document if you enable downloads (default is DOC (year-month-day).pdf).
  • OnPageChange (EventCallback<int>), response after page change action.
  • OnScaleChange (EventCallback<float>), response after scale or size change on the pages.
  • OnDegChange (EventCallback<int>), response after rotation change on the pages.

Public methods

  • They are used using @ref in the AstrolPDFViewer component. Example <AstrolPDFViewer @ref="_pdfViewer" ... />, 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.
© 2025 AstrolUI v8.0.4
Se ha producido un error no controlado. Recargar 🗙