1.10.4 • Published 9 months ago

hypnotes-pdf v1.10.4

Weekly downloads
-
License
ISC
Repository
-
Last release
9 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;
1.10.4

9 months ago

1.10.3

10 months ago

1.10.2

10 months ago

1.9.1

12 months ago

1.9.0

12 months ago

1.9.4-1

12 months ago

1.9.3-2

12 months ago

1.9.4-2

12 months ago

1.9.3-1

12 months ago

1.9.4-9

11 months ago

1.9.4-7

12 months ago

1.9.4-8

11 months ago

1.9.4-5

12 months ago

1.9.4-6

12 months ago

1.9.4-3

12 months ago

1.9.4-10

11 months ago

1.9.4-11

10 months ago

1.9.4

12 months ago

1.9.3

12 months ago

1.9.2

12 months ago

1.10.1

10 months ago

1.40.12

12 months ago

1.20.5

12 months ago

1.15.0

12 months ago

1.12.0

12 months ago

1.10.0

12 months ago

1.8.0

1 year ago

1.7.0

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.5

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago