Easy React PDF Viewer for tablet/phone base on pdf-dist.js.
*Componnent computer browser base on iframe
npm i @ogs-ltd/react-pdf-viewer
import PDFViewer from "@ogs-ltd/react-pdf-viewer";
import "@ogs-ltd/react-pdf-viewer/dist/style.css";
<PDFViewer src="{file}" />
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: ">=18.0.0"