@blocklet/pdf
TypeScript icon, indicating that this package has built-in type declarations

1.6.257 • Public • Published

@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.

Readme

Keywords

Package Sidebar

Install

npm i @blocklet/pdf

Weekly Downloads

953

Version

1.6.257

License

ISC

Unpacked Size

52.8 kB

Total Files

10

Last publish

Collaborators

  • wangshijun
  • gxw