├── .eslintrc.json
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── next.config.js
├── package-lock.json
├── package.json
├── pages
├── _app.js
├── api
│ └── hello.js
├── guide.js
└── index.js
├── postcss.config.js
├── public
├── darkNavLogo.png
├── lightNavLogo.png
├── logo.png
├── navLogo.png
├── note
│ ├── note1.png
│ ├── note2.png
│ ├── note3.png
│ ├── note4.png
│ └── note5.png
└── robots.txt
├── src
├── components
│ ├── ExportPopup.js
│ ├── FileUpload.js
│ ├── Guide.js
│ ├── Header.js
│ ├── Icon.js
│ ├── Loader.js
│ └── SideBar.js
└── context
│ └── CanvasContext.js
├── styles
├── Home.module.css
└── globals.css
├── tailwind.config.js
└── yarn.lock
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "next/core-web-vitals"
3 | }
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | *.pem
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 | .pnpm-debug.log*
27 |
28 | # local env files
29 | .env*.local
30 |
31 | # vercel
32 | .vercel
33 |
34 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | When contributing to this repository, please first discuss the change you wish to make via issue,
4 | email, or any other method with the owners of this repository before making a change.
5 |
6 | Please note we have a code of conduct, please follow it in all your interactions with the project.
7 |
8 | ## Pull Request Process
9 |
10 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a
11 | build.
12 | 2. Update the README.md with details of changes to the interface, this includes new environment
13 | variables, exposed ports, useful file locations and container parameters.
14 | 3. Increase the version numbers in any examples files and the README.md to the new version that this
15 | Pull Request would represent.
16 | 4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
17 | do not have permission to do that, you may request the second reviewer to merge it for you.
18 |
19 | ## Code of Conduct
20 |
21 | ### Our Pledge
22 |
23 | In the interest of fostering an open and welcoming environment, we as
24 | contributors and maintainers pledge to making participation in our project and
25 | our community a harassment-free experience for everyone, regardless of age, body
26 | size, disability, ethnicity, gender identity and expression, level of experience,
27 | nationality, personal appearance, race, religion, or sexual identity and
28 | orientation.
29 |
30 | ### Our Standards
31 |
32 | Examples of behavior that contributes to creating a positive environment
33 | include:
34 |
35 | * Using welcoming and inclusive language
36 | * Being respectful of differing viewpoints and experiences
37 | * Gracefully accepting constructive criticism
38 | * Focusing on what is best for the community
39 | * Showing empathy towards other community members
40 |
41 | Examples of unacceptable behavior by participants include:
42 |
43 | * The use of sexualized language or imagery and unwelcome sexual attention or
44 | advances
45 | * Trolling, insulting/derogatory comments, and personal or political attacks
46 | * Public or private harassment
47 | * Publishing others' private information, such as a physical or electronic
48 | address, without explicit permission
49 | * Other conduct which could reasonably be considered inappropriate in a
50 | professional setting
51 |
52 | ### Our Responsibilities
53 |
54 | Project maintainers are responsible for clarifying the standards of acceptable
55 | behavior and are expected to take appropriate and fair corrective action in
56 | response to any instances of unacceptable behavior.
57 |
58 | Project maintainers have the right and responsibility to remove, edit, or
59 | reject comments, commits, code, wiki edits, issues, and other contributions
60 | that are not aligned to this Code of Conduct, or to ban temporarily or
61 | permanently any contributor for other behaviors that they deem inappropriate,
62 | threatening, offensive, or harmful.
63 |
64 | ### Scope
65 |
66 | This Code of Conduct applies both within project spaces and in public spaces
67 | when an individual is representing the project or its community. Examples of
68 | representing a project or community include using an official project e-mail
69 | address, posting via an official social media account, or acting as an appointed
70 | representative at an online or offline event. Representation of a project may be
71 | further defined and clarified by project maintainers.
72 |
73 | ### Enforcement
74 |
75 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
76 | reported by contacting the project team at [divyakumarbaid.dkb.2001@gmail.com]. All
77 | complaints will be reviewed and investigated and will result in a response that
78 | is deemed necessary and appropriate to the circumstances. The project team is
79 | obligated to maintain confidentiality with regard to the reporter of an incident.
80 | Further details of specific enforcement policies may be posted separately.
81 |
82 | Project maintainers who do not follow or enforce the Code of Conduct in good
83 | faith may face temporary or permanent repercussions as determined by other
84 | members of the project's leadership.
85 |
86 | ### Attribution
87 |
88 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
89 | available at [http://contributor-covenant.org/version/1/4][version]
90 |
91 | [homepage]: http://contributor-covenant.org
92 | [version]: http://contributor-covenant.org/version/1/4/
93 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Divya Kumar Baid
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
DocType
Hussle Free PDF editor !
7 |
8 |
9 | [](https://github.com/DivyaKumarBaid/DocType/blob/main/LICENSE) [](https://github.com/DivyaKumarBaid/DocType/network) [](https://github.com/DivyaKumarBaid/DocType/stargazers)
10 |
11 |
12 |
13 | ## Description
14 |
15 | A Hussle free solution to edit PDF. Easier to work with, this PDF editor is based on FabricJs built on React-pdf which would be a lot smoother working with day to day PDF. Download the edited PDF in an instant. Be it multipage, single page just edit and download the whole PDF or even a single page.
16 |
17 | ---
18 |
19 | ## Features
20 |
21 |
22 |
23 | | Sticky Notes | Add a sticky note to your pdf to know important topic |
24 | | ------------------ | ------------------------------------------------------ |
25 | | Shape Tool | Add elementry shapes such as reactangle and circle. |
26 | | Text Box | Add a TextBox in your PDF and take down extra notes. |
27 | | Image | Add an image to the PDF. |
28 | | Pencil | Lets you free draw on PDF. |
29 | | Highlighter | Highlight anything in your PDF. |
30 | | Delete | Delete the selected edited element. |
31 | | Clear Editor | Restor/Delete the whole edited part. |
32 | | Download Page | Download the current page with edited elements. |
33 | | Download PDF | Download the while PDF with edited elements. |
34 | | Color Picker | Pick a color for the included shapes and lines. |
35 |
36 |
37 |
38 | ---
39 |
40 | ## Forking and Hosting
41 |
42 | Fork the repository and host it in netlify.
43 | Currently I am having error while deploying the repository on vercel due to canvas issue with nextjs
44 | To run it locally, clone the repository and run ```npm i```
45 |
46 | ---
47 |
48 | For any other Questions raise an issue and I will try to solve you problem.
49 |
--------------------------------------------------------------------------------
/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | reactStrictMode: true,
4 | swcMinify: true,
5 | }
6 |
7 | module.exports = nextConfig
8 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "doc",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "@emotion/react": "^11.10.5",
13 | "@emotion/styled": "^11.10.5",
14 | "@headlessui/react": "^1.7.7",
15 | "@mui/material": "^5.11.6",
16 | "@next/font": "^13.1.6",
17 | "@react-18-pdf/renderer": "^2.3.4",
18 | "animejs": "^3.2.1",
19 | "fabric": "^5.3.0",
20 | "html2canvas": "^1.4.1",
21 | "jspdf": "^2.5.1",
22 | "next": "13.1.6",
23 | "react": "18.2.0",
24 | "react-color": "^2.19.3",
25 | "react-dom": "18.2.0",
26 | "react-dropzone": "^14.2.3",
27 | "react-icons": "^4.7.1",
28 | "react-pdf": "^6.2.2"
29 | },
30 | "devDependencies": {
31 | "autoprefixer": "^10.4.13",
32 | "eslint": "8.33.0",
33 | "eslint-config-next": "13.1.6",
34 | "postcss": "^8.4.21",
35 | "tailwindcss": "^3.2.4"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/pages/_app.js:
--------------------------------------------------------------------------------
1 | import Header from '../src/components/Header'
2 | import { CanvasProvider } from '../src/context/CanvasContext'
3 | import '../styles/globals.css'
4 |
5 | function MyApp({ Component, pageProps }) {
6 | return (
7 | <>
8 |
9 |
10 |
11 |
12 | >
13 | )
14 | }
15 |
16 | export default MyApp
17 |
--------------------------------------------------------------------------------
/pages/api/hello.js:
--------------------------------------------------------------------------------
1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2 |
3 | export default function handler(req, res) {
4 | res.status(200).json({ name: 'John Doe' })
5 | }
6 |
--------------------------------------------------------------------------------
/pages/guide.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Guide from '../src/components/Guide'
3 |
4 | export default function GuidePage() {
5 | return (
6 |
7 | )
8 | }
9 |
--------------------------------------------------------------------------------
/pages/index.js:
--------------------------------------------------------------------------------
1 | import FileUpload from "../src/components/FileUpload";
2 | import Head from 'next/head'
3 | import React from "react";
4 |
5 | export default function Home() {
6 |
7 | return (
8 |
18 | - Allows users to add a Sticky Notes on any page of the PDF document.
19 |
20 |
21 |
Shape Tool
- Allows users to add a rectangle or a circle on any page of the PDF document.
22 |
Text Box
- Allows users to add an editable text box on any page of the PDF document.
23 |
Image
- Allows users to add an image on any page of the PDF document.
24 |
Pencil
- Allows users to draw any shape or make freehand annotations on the PDF document.
25 |
Highlighter
- Allows users to highlight any text or image on any page of the PDF document.
26 |
Delete
- Allows users to remove unwanted annotations or shapes from the PDF document.
27 |
Delete All
- Allows users to clear all annotations or shapes from a specific page of the PDF document.
28 |
Download PDF
- Allows users to download the updated PDF document in .pdf format.
29 |
Download Page
- Allows users to download a specific page from the PDF document in .pdf format.
30 |
Colour Picker
- Allows users to pick a color of their choice. - The selected color will be applied to all subsequent annotations or shapes created with the other tools