react-base64-to-pdf
A React component library for showing details about, previewing and downloading Base64-encoded PDF files.
- Role
- Author & maintainer
- Context
- Open-source npm package
- Stack
- React, TypeScript, npm

Overview
An npm package that makes it easy to work with Base64-encoded PDF files in React. I built it because the existing packages didn't offer a reliable, flexible viewer for this format.
It gives React apps three components: one shows a PDF's details, one previews its content in the page, and one downloads it with a single click.
Components
- 01
PDFInfo
Shows the file size, PDF version, creation and modification dates, and the tool used to create it.
- 02
PDFPreview
Renders the PDF inside the app, with optional style and className props for custom styling.
- 03
PDFDownloadButton
A download button with an optional file name (defaults to file.pdf) and custom styles.
Using it
- 01
Install
npm install react-base64-to-pdf
- 02
One required prop
Every component takes a base64 string. Styling props are optional.
- 03
Open source
MIT licensed, with the source on GitHub.