@ogs-ltd/react-pdf-viewer
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

<style> r { color: Red } o { color: Orange } g { color: Green } bl { color: Blue } </style>
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" 

Package Sidebar

Install

npm i @ogs-ltd/react-pdf-viewer

Weekly Downloads

2

Version

1.0.4

License

ISC

Unpacked Size

1.43 MB

Total Files

12

Last publish

Collaborators

  • n.kalvibool