@component-hook/pdf-canvas 0.2.0 → 0.2.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @component-hook/pdf-canvas
2
2
 
3
- Rendering PDF documents onto a canvas with vue3 and react component ([DEMO](https://tzuyi0817.github.io/component-hook/#/component/pdf-canvas))
3
+ Rendering PDF documents onto a canvas with vue3 and react component ([DEMO](https://tzuyi0817.github.io/component-hook/#/component/vue-pdf-canvas))
4
4
  Implementation depository: [PDF-signature](https://github.com/tzuyi0817/PDF-signature)
5
5
 
6
6
  <p>
@@ -84,7 +84,7 @@ async function uploadFile(event: Event) {
84
84
 
85
85
  ## Usage with React
86
86
 
87
- ```jsx
87
+ ```tsx
88
88
  import { useState, type ChangeEvent } from 'react';
89
89
  import PdfCanvas, { useFabric, type PDF } from '@component-hook/pdf-canvas/react';
90
90
 
@@ -120,24 +120,23 @@ export function DrawPdf() {
120
120
  </div>
121
121
  );
122
122
  }
123
-
124
123
  ```
125
124
 
126
125
  ## Attributes
127
126
 
128
- | Name | Required | Type | Description | Default |
129
- | ---------------- | -------- | --------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
130
- | file | true | `PDF` | The data is generated by loadFile of useFabric hook | — |
131
- | page | false | `number` | The page number you want to display | 1 |
132
- | canvasId | false | `string` | Canvas dom prefix id selector - `${canvasId}-${page - 1}` | PDF-canvas |
133
- | fileZoom | false | `number` | Zoom in and out of the displayed canvas | 1 |
134
- | fileScale | false | `number` | The actual size of the canvas will affect the display clarity | 1 |
135
- | canvasClass | false | `string` | Canvas dom class selector | — |
136
- | isDrop | false | `boolean` | Control whether to drag and drop images and text onto the canvas | false |
137
- | password | false | `string` | Open password for encrypted PDF files | — |
138
- | dropTextOptions | false | `object` | [fabric.js FabricText options](https://github.com/fabricjs/fabric.js) | [text options](https://github.com/tzuyi0817/component-hook/blob/master/packages/pdf-canvas/configs/index.ts) |
139
- | dropImageOptions | false | `object` | [fabric.js FabricImage options](https://github.com/fabricjs/fabric.js) | [image options](https://github.com/tzuyi0817/component-hook/blob/master/packages/pdf-canvas/configs/index.ts) |
140
- | closeSvgOptions | false | `object` | Setup close svg options | [close options](https://github.com/tzuyi0817/component-hook/blob/master/packages/pdf-canvas/configs/index.ts) |
127
+ | Name | Required | Type | Description | Default |
128
+ | ---------------- | -------- | --------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
129
+ | file | true | `PDF` | The data is generated by loadFile of useFabric hook | — |
130
+ | page | false | `number` | The page number you want to display | 1 |
131
+ | canvasId | false | `string` | Canvas dom prefix id selector - `${canvasId}-${page - 1}` | PDF-canvas |
132
+ | fileZoom | false | `number` | Zoom in and out of the displayed canvas | 1 |
133
+ | fileScale | false | `number` | The actual size of the canvas will affect the display clarity | 1 |
134
+ | canvasClass | false | `string` | Canvas dom class selector | — |
135
+ | isDrop | false | `boolean` | Control whether to drag and drop images and text onto the canvas | false |
136
+ | password | false | `string` | Open password for encrypted PDF files | — |
137
+ | dropTextOptions | false | `object` | [fabric.js FabricText options](https://github.com/fabricjs/fabric.js) | [text options](https://github.com/tzuyi0817/component-hook/blob/master/packages/pdf-canvas/src/shared/configs/index.ts) |
138
+ | dropImageOptions | false | `object` | [fabric.js FabricImage options](https://github.com/fabricjs/fabric.js) | [image options](https://github.com/tzuyi0817/component-hook/blob/master/packages/pdf-canvas/src/shared/configs/index.ts) |
139
+ | closeSvgOptions | false | `object` | Setup close svg options | [close options](https://github.com/tzuyi0817/component-hook/blob/master/packages/pdf-canvas/src/shared/configs/index.ts) |
141
140
 
142
141
  ## Exposes
143
142