React PDF Viewer
Docs
Plugins
Localizations
Examples
Updates
Purchase
Examples
The sample codes for examples and
plugins
can be found on this
GitHub repo
Troubleshooting
Compile and set the worker source with Webpack
How to solve the "SyntaxError: Unexpected token" issue
Keep the worker version in sync with pdfjs-dist version
View documents from remote servers
Basic examples
Add a watermark
Add buttons to each page for rotating the target page
Add margin between pages
Customize error renderer
Customize loader renderer
Customize the protected view
Disable text selection
Display signatures in a PDF document
Preview a document inside a modal
Preview a PDF file before uploading
Preview a PDF file from an array of bytes
Preview a PDF file from base 64
Replace the canvas with SVG layer
Set the initial page
Set the initial rotation
Set the page from last visit as the initial page
Single page view
Submit the password programmatically
Support Internet Explorer 11
Use a different language
Use a RTL language
Use multiple viewers in the same page
Plugins
Create your own plugins
Display the thumbnail of a given page
Display reading progress at the top
Draw on top of the canvas layer
Find and replace links found in each page
Open a confirmation modal when users click a link
Zoom to a specific level programmatically
Attachment plugin
List attachments
Bookmark plugin
Add a button to the default toolbar to toggle the bookmarks
Customize bookmark items
Execute a function when users click a bookmark item
List bookmarks
Set a bookmark expanded or collapsed initially
Default Layout plugin
Add a custom element to the toolbar of the default layout
Add a new tab to the sidebar
Change the order of tabs in the sidebar
Create a toolbar with custom buttons for the default layout
Create a toolbar with different slots for the default layout
Open a tab in the sidebar when the document is loaded
Remove a tab from the sidebar
Remove all tabs from the sidebar
Set the initial tab based on the document's page mode
Set the initial tab in the default layout
Use the default layout
Drop plugin
Drag and drop a PDF document to open it
Full Screen plugin
Customize the button to exit the full screen mode
Customize the full screen button
Include the default toolbar in the full screen mode
Use the default full screen button
Zoom to fit the screen after entering the full screen mode
Get File plugin
Customize the download button
Customize the name of download file
Use the default download button
Highlight plugin
Render the highlight areas
Locale Switcher plugin
Add the locale switcher to the toolbar
Open plugin
Customize the open button
Use the default open button
Page Navigation plugin
Customize the navigation buttons
Display the current page
Show the custom page label for the current page
Slide presentation
Use the default navigation buttons
Print plugin
Customize the print button
Customize the progress bar when preparing pages to print
Determine the target pages to print from users input
Hide unnecessary elements when printing a document
Print the current document programmatically
Set the target pages when printing a document
Use the default print button
Properties plugin
Customize the button to list the document properties
Use the default button to list the document properties
Rotate plugin
Customize the rotate buttons
Use the default rotate buttons
Use the RotatePage component to rotate a particular page
Scroll Mode plugin
Customize the buttons to switch the scroll mode
Use the default buttons to switch the scroll mode
Switch to a scroll mode
Search plugin
Add custom styles to the highlighted elements
Create a custom search control
Customize the button to show the search popover
Customize the search highlighted elements
Highlight keywords programmatically
Highlight multiple keywords initially
Jump to the first match of pre-defined keywords automatically
Set the target pages that you want to search in
Show search results in a sidebar
Show search results in the sidebar of the default layout
Use the default button to show the search popover
Selection Mode plugin
Customize the buttons to switch the selection mode
Use the default buttons to switch the selection mode
Theme plugin
Switch to the dark or light theme automatically
Use the default button to switch themes
Use the dark theme
Use the last chosen theme
Thumbnail plugin
Add buttons to rotate a single thumbnail and its associated page
Customize the width of thumbnails
Customize thumbnail items
Customize thumbnail spinners
Display the thumbnail of a given page
Magazine layout
Preview pages as thumbnails
Show custom page labels for thumbnails
Toolbar plugin
Create a custom toolbar
Create a floating toolbar
Create a toolbar with more options
Customize the default toolbar
Remove some parts from the default toolbar
Toolbar slot
Use the default toolbar
Zoom plugin
Customize the zoom buttons
Customize the zoom levels
Use the default zoom buttons
Zoom to a specific level