React PDF Viewer
Easy React PDF Viewer for tablet/phone base on pdf-dist.js.
*Componnent computer browser base on iframe
Install
npm i @ogs-ltd/react-pdf-viewer
Example
Importing
import PDFViewer from "@ogs-ltd/react-pdf-viewer";
import "@ogs-ltd/react-pdf-viewer/dist/style.css";
Usage
<PDFViewer src="{file}" />
<style> r { color: Red } o { color: Orange } g { color: Green } bl { color: Blue } </style> Props
Prop name | Description | Default |
---|---|---|
src * | imported using import … from … or "url" - URL |
n/a |
pageInfoTextFormat(optional) |
Function (curent: number, totals: number) => string
|
(curent: number, totals: number) => `หน้า ${curent} จาก ${totals}` |
optionText(optional) | Custom option text by object { save: string; save_loading: string; zoom: string; expand: string; exit_expand: string; }
|
object { save: "บันทึกไฟล์", save_loading: "กำลังบันทึกไฟล์", zoom: "ซูม", expand: "ขยายเต็มจอ", exit_expand: "ออกจากโหมดเต็มจอ" }
|
Node version requirements
node: ">=18.0.0"