1.0.4 • Published 3 months ago

@ogs-ltd/react-pdf-viewer v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

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}" />

Props

Prop nameDescriptionDefault
src *imported using import … from … or "url" - URLn/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"