2.3.0 • Published 6 months ago

hypnotes-pdf v2.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

Navigation Index

  1. Form Create
  2. Form Fill

FormCreate Component

This FormCreate component is designed for creating forms on top of a given PDF document. Users can add form fields, input fields, and signatures to the PDF document. The component supports zoom in/out, next/previous page navigation, and saving the document with added fields.

Features

  • Render a PDF document with the provided pdfUrl
  • Add form fields (text, checkbox, and signature) and input fields (text and signature) to the PDF document
  • Resize and move form and input fields
  • Navigate through the pages of the PDF document
  • Zoom in and out of the PDF document
  • Save the PDF document with the added fields

Props

  • pdfUrl: String (required) - The URL of the PDF document to be rendered
  • onSaveDocument: Function (required) - Callback function to be called when the "Save" button is clicked, receiving the form fields and input fields as arguments

Dependencies

  • pdfjs-dist: A library to parse and render PDF documents
  • react-signature-canvas: A library to create signature input fields
  • Custom hooks: usePdfRenderer, useWindowSize

Usage

import FormCreate from "./FormCreate";

const App = () => {
  const pdfUrl = "/path/to/your/pdf/document.pdf";

  const handleSaveDocument = (formFields, inputFields) => {
    // Save the document with added fields
    // ...
  };

  return (
    <div>
      <FormCreate pdfUrl={pdfUrl} onSaveDocument={handleSaveDocument} />
    </div>
  );
};

export default App;

FormFill Component

The FormFill component allows users to fill out forms on a given PDF document. It supports text, checkbox, and signature input fields, and allows users to navigate through the PDF document, zoom in and out, and save the filled document.

Features

  • Render a PDF document with the provided pdfUrl
  • Fill out text, checkbox, and signature input fields
  • Navigate through the pages of the PDF document
  • Zoom in and out of the PDF document
  • Save the filled PDF document

Props

  • pdfUrl: String (required) - The URL of the PDF document to be rendered
  • formFields: Array (required) - An array of form fields to be rendered on the PDF document
  • onSaveDocument: Function (required) - Callback function to be called when the "Save" button is clicked, receiving the form fields and input fields as arguments

Dependencies

  • pdfjs-dist: A library to parse and render PDF documents
  • react-signature-canvas: A library to create signature input fields
  • Custom hooks: usePdfRenderer, useWindowSize

Usage

import React from "react";
import FormFill from "./FormFill";

const App = () => {
  const pdfUrl = "/path/to/your/pdf/document.pdf";
  const formFields = [/* ... */];

  const handleSaveDocument = (formFields, inputFields) => {
    // Save the document with added fields
    // ...
  };

  return (
    <div>
      <FormFill pdfUrl={pdfUrl} formFields={formFields} onSaveDocument={handleSaveDocument} />
    </div>
  );
};

export default App;
2.2.0

7 months ago

2.0.1

8 months ago

2.3.0

6 months ago

2.1.2

7 months ago

2.1.1

7 months ago

2.1.4

7 months ago

2.1.3

7 months ago

2.1.5

7 months ago

2.1.0

7 months ago

2.0.0

8 months ago

1.10.5

11 months ago

1.13.0

10 months ago

1.10.6

11 months ago

1.11.0

11 months ago

1.10.4

2 years ago

1.10.3

2 years ago

1.10.2

2 years ago

1.9.1

2 years ago

1.9.0

2 years ago

1.9.4-1

2 years ago

1.9.3-2

2 years ago

1.9.4-2

2 years ago

1.9.3-1

2 years ago

1.9.4-9

2 years ago

1.9.4-7

2 years ago

1.9.4-8

2 years ago

1.9.4-5

2 years ago

1.9.4-6

2 years ago

1.9.4-3

2 years ago

1.9.4-10

2 years ago

1.9.4-11

2 years ago

1.9.4

2 years ago

1.9.3

2 years ago

1.9.2

2 years ago

1.10.1

2 years ago

1.40.12

2 years ago

1.20.5

2 years ago

1.15.0

2 years ago

1.12.0

2 years ago

1.10.0

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.5

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago