• Stars
    star
    198
  • Rank 196,898 (Top 4 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sign and request signatures on PDFs, MS Office documents

PDFTron Sign App

PDFTron Sign App demonstrates building a signing application where users can request signatures on the documents by placing fields, sign documents, review signed documents using PDFTron PDF SDK.

Watch the video here: image

This repo is designed to help to get started in creating your own signing workflow.

What is new in the latest release

Watch a quick recap

  • Ability to add date fields
  • Ability to see when the document was requested and signed
  • Update WebViewer to 10.0

Install

Watch this quick video to setup this project.

npm install

Firebase Configuration

This application uses Firebase to store PDFs and data for signatures. You can use any other backend of your choice. However, to get started with this sample, please register a new app with Firebase.

After you have registered an app, create .env file in the root of the directory and place the following:

REACT_APP_API_KEY=your_key_goes_here
REACT_APP_MESSAGING_SENDER_ID=your_key_goes_here
REACT_APP_APP_ID=your_key_goes_here
REACT_APP_AUTH_DOMAIN=your_domain_goes_here
REACT_APP_DATABASE_URL=your_database_go_here
REACT_APP_PROJECT_ID=your_project_id
REACT_APP_STORAGE_BUCKET=your_storage_bucket

The above information can be found under settings of your Firebase app. Screenshot

Make sure you create a storage bucket, and enable authentication for email and Google. Screenshot

After you have your storage bucket and Firestore setup give authenticated users read and write permissions.

Rules for storage which will host your PDF documents. Screenshot

Rules for Firestore which will host document signing metadata. Screenshot

Change Firestore Database rules to:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.auth != null;
    }
  }
}

Change Storage rules to:

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write: if request.auth != null;
    }
  }
}

Now you can run the application and start requesting signatures.

CORS

You will need to set up CORS on your Firestore to allow WebViewer to access files stored in your bucket. I created a CORS file called cors.json:

[
  {
    "origin": ["*"],
    "method": ["GET"],
    "maxAgeSeconds": 3600
  }
]

And then used gsutil to update it: https://cloud.google.com/storage/docs/configuring-cors

The walkthrough recommends siging up for billing but that is not necessary to use this demo.

Run

npm start

Project structure

src/
  app/             - Redux Store Configuration
  components/      - React components
    Assign/              - Add users to a document that needs to be signed 
    Lists/               - List components to list files for signing and review
    MergeAnnotations/    - Merge all signatures and flatten them onto a PDF 
    PasswordReset/       - Reset password
    PrepareDocument/     - Drag and drop signatures, text fields onto a PDF to prepare it for signing
    Profile/             - Profile information and a sign out button
    SignDocument/        - Sign PDF
    SignIn/              - Sign in
    SignUp/              - Sign up
    ViewDocument/        - Review document after signing
    AssignUsers          - Component combines Profile and Assign
    Header               - Header when the user is not logged in
    Preparation          - Component combines Profile and PrepareDocument
    Sign                 - Component combines Profile and SignDocument
    View                 - Component combines Profile and ViewDocument
    Welcome              - Component combines Profile, SignList, Preparation, SignedList
  App              - Configuration for navigation, authentication
  index            - Entry point and configuration for React-Redux
  firebase/        - Firebase configuration for authentication, updating documents, storing PDFs
  tools/           - Helper function to copy over PDFTron dependencies into /public on post-install

Firebase Document Structure

docRef: docToSign/c4Y72M0d0pZx3476jxJFxrFA3Qo21593036106369.pdf"
email: "[email protected]"
emails: ["[email protected]"]
signed: true
signedBy: ["[email protected]"]
requestedTime: July 17, 2020 at 12:01:24 PM UTC-7
signedTime: July 17, 2020 at 12:01:24 PM UTC-7
uid: "c4Y72M0d0pZx3476jxJFxrFA3Qo2"
xfdf: ["<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">...</xfdf>"]
  • docRef - string - storage reference to the actual PDF
  • email - string - email of the requestor of the signature
  • emails - an array of strings - users to sign the document
  • signed - boolean - value for whether or not all users have signed the document (gets determined by checking lengths of emails array and xfdf array)
  • requestedTime - TimeStamp - value for when the signature was requested
  • signedTime - TimeStamp - value for when the document was signed
  • uid - string - unique identifier for the requestor of the signature
  • xfdf - an array of strings - signature appearance/form field values for each user

API documentation

See API documentation.

License

See license.

More Repositories

1

webviewer-ui

WebViewer UI built in React
JavaScript
405
star
2

pdftron-flutter

A convenience wrapper for building Flutter apps with PDFTron mobile SDK.
Java
170
star
3

webviewer-react-sample

Sample to demonstrate integrating WebViewer into React
JavaScript
156
star
4

pdftron-react-native

A convenience wrapper for building react native apps with PDFTron mobile SDK.
Objective-C
106
star
5

webviewer-vue-sample

Sample to demonstrate integrating WebViewer into Vue
Vue
99
star
6

pdftron-android-samples

PDFTron Android Samples
Kotlin
57
star
7

web-to-pdf

Convert any web technology to PDF (HTML to PDF, html2pdf)
JavaScript
52
star
8

PDFNetWrappers

Code repository for building different language bindings for PDFNetC.
SWIG
48
star
9

webviewer-video-sample

Annotate videos frame-by-frame collaboratively
JavaScript
44
star
10

pdftron-document-search

Build search across multiple documents client-side in your file storage
JavaScript
42
star
11

webviewer-angular-sample

Sample to demonstrate integrating WebViewer into Angular
TypeScript
41
star
12

webviewer-salesforce

LWC component to view, annotate and edit PDFs, MS Office, images in Salesforce
JavaScript
38
star
13

pdftron-android-ocr-scanner-sample

Android Scanner with OCR support using PDFTron
Kotlin
31
star
14

webviewer-react-toolkit

A React component library for integrating with PDFTron WebViewer API.
TypeScript
24
star
15

rails-generate-pdf

rails-generate-pdf
Ruby
21
star
16

webviewer-realtime-collaboration-sqlite3-sample

WebViewer sample to show how you can create a real time collaboration app with WebViewer using WebSocket, SQLite3, and Node.js server.
JavaScript
20
star
17

webviewer-electron-sample

Sample to demonstrate integrating WebViewer into an Electron App
JavaScript
19
star
18

webviewer-nextjs-sample

CSS
14
star
19

pdftron-go

PDFTron GoLang
Go
14
star
20

pdf-in-react

Boilerplate for rendering a PDF using React
JavaScript
13
star
21

pdftron-cordova

A plugin for building Cordova and Ionic apps with PDFTron's iOS and Android native PDF SDKs.
Java
13
star
22

webviewer-barcode

Stamp and read barcodes using WebViewer SDK
JavaScript
13
star
23

webviewer-custom-ui

Demonstrates how to get started with making your own UI
JavaScript
13
star
24

webviewer-3d-sample

View, annotate and collaborate on GLB, GLTF models
CSS
11
star
25

Android-Getting-Started

Shows how to view and annotate a PDF on Android using PDFNet.
Java
11
star
26

android-pdf-viewer

Blog: How to Build an Android PDF Viewer Using Java
Java
9
star
27

webviewer-document-merge

Drag and drop PDFs, MS Office, images to assemble documents.
JavaScript
9
star
28

webviewer-blazor-sample

A sample project demonstrating how to integrate PDFTron's WebViewer into a Blazor server project
HTML
9
star
29

pdf-viewer-android

Android Quick Start Guide: Add a document viewer using the PDFTron Android SDK
Java
9
star
30

pdf-viewer-swift

Boilerplate for adding a PDF viewer to a Swift app.
Swift
9
star
31

xamarin-forms-sample

This sample shows how to use PDFTron for Xamarin in Xamarin.Forms project via PageRenderer. You can run this sample on Android, iOS and UWP. It shows a simple PDFViewCtrl with annotation functionality.
C#
9
star
32

flutter-sample

Sample to demonstrate integrating PDFTron in Flutter
Dart
8
star
33

salesforce-pdf-app

Demo app for showcasing file upload/handling, searching, ContentReplacer, Redaction etc.
Apex
8
star
34

webviewer-cordova-sample

A sample WebViewer app in Cordova/Ionic.
CSS
7
star
35

salesforce-webviewer-attachments

JavaScript
7
star
36

webviewer-blazor-wasm-sample

A sample project demonstrating how to integrate PDFTron's WebViewer into a Blazor WebAssembly project
HTML
7
star
37

webviewer-svelte-sample

Sample to demonstrate integrating WebViewer into Svelte
JavaScript
7
star
38

iOS-Getting-Started

Shows how to view and annotate a PDF on iOS using PDFNet.
Objective-C
7
star
39

webviewer-annotations-php-sample

WebViewer sample that shows saving annotations to XFDF files in PHP
JavaScript
6
star
40

ng5-pdf-viewer-ui

ng5-pdf-viewer-ui
TypeScript
6
star
41

pdftron-android-blogs

This repository contains sample projects that accompany relevant PDFTron Android blog posts.
Kotlin
6
star
42

webviewer-annotations-document-sample

WebViewer sample that shows saving annotations back to PDF file in Node.js
JavaScript
6
star
43

react-native-sample

Sample to demonstrate integrating PDFTron in React Native
TypeScript
6
star
44

webviewer-typescript-sample

JavaScript
6
star
45

webviewer-generate-docx

Generate DOCX, and save as a PDF, all client-side in the browser.
JavaScript
6
star
46

pdfjs-express-typescript

JavaScript
5
star
47

webviewer-html-annotate-proxy

JavaScript
5
star
48

nodejs-mail-to-pdf

Convert emails EML to a PDF with all attachments
JavaScript
5
star
49

webviewer-html-annotate

Annotate live HTML web pages by providing URL
JavaScript
5
star
50

webviewer-user-bookmarks-nodejs-sample

WebViewer sample that shows saving user bookmarks to a json file in nodejs
JavaScript
5
star
51

pdftron-react-and-react-native-sample

A sample project that uses Expo and shows how to create a PDF viewer app for both web and mobile with a single codebase between React and React Native.
Java
5
star
52

PDFNetLoader

.Net assembly to load 32 or 64 bit PDFNet at runtime. This allows for easier intergration with the AnyCPU platform.
C#
5
star
53

webviewer-typescript

JavaScript
4
star
54

webviewer-mendix-sample

Mendix PDF, MS Office, image viewer and editor. Review and approve, annotate documents, split/merge pages.
TypeScript
4
star
55

pdftron-android-barcode

Stamp and read barcodes using PDFTron Android SDK
Kotlin
4
star
56

webviewer-annotations-nodejs-sample

WebViewer sample that shows saving annotations to XFDF files in Node.js
JavaScript
4
star
57

webviewer-react-toolkit-demo

An example implementation of WebViewer React Toolkit.
TypeScript
4
star
58

webviewer-salesforce-apex-example

WebViewer demo in Lightning Web Component (LWC) and Apex class in Salesforce
JavaScript
4
star
59

webviewer-annotations-aspnet-sample

WebViewer sample that shows saving annotations to XFDF files in ASP.NET
C#
4
star
60

angular-pdf-ui

angular-pdf-ui
JavaScript
3
star
61

pdfjs-typescript

JavaScript
3
star
62

pdftron-apple-package

PDFTron iOS Swift Package
Swift
3
star
63

website-reviewer

A sample application showing how to combine PDFTron technology to build a website reviewal app
TypeScript
3
star
64

webviewer-offline-sample

CSS
3
star
65

webviewer-js-sample

A simple JS application demonstrating how to embed PDFTron's WebViewer
JavaScript
3
star
66

cordova-sample

This project is no longer maintained. Please see https://github.com/PDFTron/webviewer-cordova-sample.
Java
3
star
67

webviewer-collab-advanced-sample

A sample project using the WebViewer Collaboration modules
TypeScript
2
star
68

webviewer-audio-sample

CSS
2
star
69

salesforce-webviewer-diff

A semantic diff sample for WebViewer in Salesforce
JavaScript
2
star
70

webviewer-appian-sample

Appian PDF, MS Office, image viewer and editor. Review and approve, annotate documents, split/merge pages.
JavaScript
2
star
71

salesforce-webviewer-scorpio

Spinoff of https://github.com/PDFTron/salesforce-webviewer-attachments with compatability to S3 links. Added modifications to work with LMS and to auto load most recently created attachment
JavaScript
2
star
72

webviewer-html-proxy-server

TypeScript
2
star
73

webviewer-cors

Load WebViewer's lib on a different domain
TypeScript
2
star
74

pdftron-uwp-samples

C#
2
star
75

aws-function-example

Example code for using PDFTron SDK in an AWS Lambda.
Python
2
star
76

webviewer-flutter-sample

Sample to demonstrate integrating WebViewer into Flutter Web
Dart
2
star
77

pdftron-winui-samples

Sample projects using PDFTron's WinUI SDK
C#
2
star
78

webviewer-server-side-search

Sample code for integrating server side search for PDFTron WebViewer
JavaScript
2
star
79

webviewer-jquery-sample

A sample project demonstrating how to integrate PDFTron's WebViewer into a jQuery project
JavaScript
2
star
80

pdftron-xamarin-samples

PDFTron Xamarin Samples
C#
2
star
81

webviewer-react

TypeScript
2
star
82

pdftron-ios-samples

Swift
2
star
83

webviewer-angularjs-sample

JavaScript
2
star
84

webviewer-angular-azure-sample

Sample to demonstrate integrating WebViewer into an Angular & Azure App
TypeScript
2
star
85

sharepoint-integration

JavaScript
1
star
86

salesforce-webviewer-document-merge

JavaScript
1
star
87

sharepoint-integration-examples

TypeScript
1
star
88

salesforce-webviewer-prepopulate

JavaScript
1
star
89

DotNetCore-GettingStarted

1
star
90

pdftron-apple-package-no-tools

Swift
1
star
91

salesforce-webviewer-video

JavaScript
1
star
92

webviewer-collab-sql-sample

A basic sample showing how to integrate WebViewer Collaboration modules with an SQL database
TypeScript
1
star
93

webviewer-collab-get-started

The repo containing the code for the WebViewer Collaboration get started guide
JavaScript
1
star
94

salesforce-webviewer-docgen

JavaScript
1
star
95

canvasToPDF-webviewer-react-sample

JavaScript
1
star
96

webviewer-codesandbox-samples

A repository that is used for showcasing PDFTron WebViewer samples in CodeSandbox
1
star
97

webviewer-tomcat-java-sample

Sample to demonstrate integrating WebViewer into an Tomcat Java App
HTML
1
star
98

react-ab

A powerful AB testing suite for React projects
TypeScript
1
star
99

webviewer-microsoft-teams-samples

Sample projects on how to integrate PDFTron's Webviewer with Microsoft Teams
TypeScript
1
star
100

flutter-unified-web-mobile-sample

Dart
1
star