@blocklet/pdf
v2.1.43
Published
blocklet pdf component
Downloads
4,211
Readme
@blocklet/pdf
@blocklet/pdf is a package that integrates the react/pdf service to provide universal pdf capability for blocklets. For more information about react/pdf, refer to the official documentation.
Package Structure
The package is composed of both frontend and backend components. The frontend code resides in the index.js
file
Development
Install In Blocklet
# You can use npm / yarn
pnpm add @blocklet/pdf
Install Dependencies
To install the required dependencies, run the following command:
pnpm i
Build Packages
To build the packages, execute the following command:
pnpm build
Build, Watch, and Run Development Server
For building, watching changes, and running the development server, use the following command:
pnpm run dev
Frontend Example
import { lazy } from 'react';
const PdfComponent = React.lazy(() =>
// @ts-ignore
import('@blocklet/pdf').then((module) => {
return {
default: module.PdfComponent,
};
})
);
---
<Box>
<PdfComponent url={pdfUrl} maxHeight="60vh" />
</Box>;
License
This package is licensed under the MIT license.