Prime PDF Viewer

PrimePDFViewer is an extension created by Akshat Developer. This extension allows you to seamlessly integrate PDF viewing functionality into your app without the need for a web viewer. With a range of customizable options, you can enhance the user experience of viewing PDF files within your application.

Author: Akshat Developer
Version:- 1.0


  1. Dark Mode
  2. Load Online, Local, Asset PDF
  3. Fast And Smooth
  4. Ability to Render Large PDF
  5. Access Links In PDF
  6. PDF Cache Function
  7. Light Weight
  8. Works In Companion Too
  9. Vertical And Horizontal Scroll
  10. And Many More



Loads the native libraries required by the extension.

LoadLibraries(libs1: text, libs2: text)


Loads a PDF file from assets.

LoadFromAssets(assetName: text, defaultPage: number, password: text, snap: boolean, fling: boolean)


Loads a PDF file from a file path.

LoadFromPath(path: text, defaultPage: number, password: text, snap: boolean, fling: boolean)


Loads a PDF file from a URI.

LoadFromUri(uri: text, defaultPage: number, password: text, snap: boolean, fling: boolean)


Loads a PDF file from an online URL.

LoadFromUrl(url: text, defaultPage: number, useCache: boolean, password: text, snap: boolean, fling: boolean)


Jumps to the provided page.

JumpTo(page: number, animate: boolean)


Sets the position offset for the current PDF page.

SetPositionOffsetWith(position: number, moveHandle: boolean)


Stops fling on PDF View.



Resets the PDF View. Removes the currently loaded PDF.



Reloads the pages of the PDF.



Performs snap on the PDF View.



Zooms to the current PDF page with the specified amount.

Zoom(zoom: number)


Fits the page to full width.

FitToWidth(page: number)


Resets the zoom. The action is performed in an animated way if animate is true.

ResetZoom(animate: boolean)


Zooms in the page with animation.

ZoomWithAnimation(zoom: number)


Gets the page present at the provided position offset.

GetPageAtPositionOffset(offset: number) : number


Gets the metadata from the provided PDF file.



Gets a list of links present in the provided PDF page.

GetLinksAt(page: number)


Deletes the cache of PDF View.



Returns if the cached PDF file for the provided URL is available.

IsCachedLocally(url: text) : boolean


Returns the path for the cached PDF file of the provided URL. Returns an empty text if no cache is available.

GetFilePathForCache(url: text) : text


  • Layout: Set the parent layout arrangement for showing the PDF View.
  • AutoSpacing: Enable/Disable autospacing for PDF pages.
  • Spacing: Set the spacing for PDF pages.
  • SwipeHorizontal: Check if the pages are being loaded horizontally.
  • DoubleTapEnabled: Check if double tap to zoom is enabled.
  • ScrollbarEnabled: Check if the scrollbar is enabled.
  • PositionOffset: Set the position offset for the current PDF page.
  • PageCount: Get the total page count of the currently loaded PDF.
  • NightMode: Enable/Disable night mode.
  • Recycled: Check if the PDF View is recycled.
  • PageFillsScreen: Check if the currently loaded page fills the screen.
  • DocumentFillsView: Check if the currently loaded PDF fills the layout.
  • CurrentPage: Get the current page of the PDF shown to the user.
  • CurrentXOffset: Get the current x offset of PDF View.
  • CurrentYOffset: Get the current y offset of PDF View.
  • Zoom: Get the zoom amount of the PDF View.
  • Zooming: Check if the user is currently zooming in the PDF View.
  • MinZoom: Set the minimum zoom for PDF View.
  • MidZoom: Set the mid zoom for PDF View.
  • MaxZoom: Set the maximum zoom for PDF View.
  • UseBestQuality: Check if the pages are being loaded in the best quality.
  • SwipeVertical: Check if swiping is being done vertically.
  • SwipeEnabled: Check if swiping is enabled.
  • AnnotationRenderingEnabled: Check if the PDF View is rendering annotations.
  • AntiAliasing: Check if anti-aliasing is enabled for the PDF View.
  • SpacingPx: Get the spacing between PDF pages in Pixels.
  • AutoSpacingEnabled: Check if automatic spacing is enabled.
  • PageFling: Check if fling is enabled for PDF pages.
  • FitEachPage: Check if PDF View is fitting each page.
  • PageSnap: Check if snapping is enabled for PDF pages.
  • RenderDuringScale: Check if PDF View will render pages even during scale.


  • OnlineFileLoaded: Triggered when an online file is loaded successfully.
  • FailedToLoadOnlineFile: Triggered when an error is encountered while downloading an online file.
  • OnlineFileLoadProgress: Triggered when the progress for downloading an online PDF file changes.
  • LinkClicked: Triggered when the user clicks on a link present in the PDF.
  • LongPress: Triggered when the user long clicks at a point in the PDF view.
  • Tap: Triggered when the user taps on a point in the PDF view.
  • InitiallyRendered: Triggered when the initial rendering of pages has succeeded.
  • PageChanged: Triggered when the current page has changed.
  • PageError: Triggered when an error is encountered while loading the page.
  • ErrorOccurred: Triggered when an error occurs while loading PDF files.
  • PageScrolled: Triggered when the PDF view is scrolled.
  • PagesLoaded: Triggered when all the pages have been loaded successfully.
  • PageDrawn: Triggered when a specific page is drawn successfully.
  • ErrorLoadingLibraries: Triggered when an error is encountered while loading the native libraries.
  • LibrariesLoaded: Triggered when all the native libraries are loaded successfully.
  • GotMetadata: Triggered when the metadata from the current PDF file is retrieved.
  • GotLinks: Triggered when the list of links present in the PDF page is retrieved successfully.


Basic Usage


Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top