Skip to content

priyanshuush/PDF-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF-Generator (Backend - ExpressJS)

This Express application serves as a PDF Generator API providing endpoints for uploading, retrieving, and extracting PDF files. It uses the pdf-lib library for PDF manipulation and multer for file uploading functionality.

API Reference

Get pdf

  GET /pdf/:filename
Parameter Type Description
filename string Required. Your pdf filename

Upload pdf

  POST /upload
Form Data Type Description
file application/pdf Required. pdf file

Register user

  POST /register
Body Type Description
`{ json Required. email, password
"email": "email",
"password": "password"
}`

Login user

  POST /login
Body Type Description
`{ json Required. email, password
"email": "email",
"password": "password"
}`

Extract Pages

  POST /extract-pages
Body Type Description
`{ json Required. filename, selectedPages
"filename": "sample.pdf",
"selectedPages": [1, 3, 7],
"newFilename": "custom_extracted_file.pdf"
}`

Extract Pages For Logged In User

  POST /login/extract-pages
Body Type Description
`{ json Required. filename, selectedPages
"filename": "sample.pdf",
"selectedPages": [1, 3, 7],
"newFilename": "custom_extracted_file.pdf"
}`

Installation

Install pdf-generator with git:

  git clone https://github.com/ugauniyal/PDF-Generator.git
  cd PDF-Generator/backend

Run pdf-generator.:

  node pdf-generator.js

Screenshots

Upload PDF

Upload PDF Screenshot


Retrieve PDF

Retrieve PDF Screenshot


Extract pages of PDF

Extract pages of PDF Screenshot


Running Tests

To run tests, run the following command. I used supertest to create the tests and jest for running the tests.

  npm test

Deployment

https://pdf-generator-3n4m.onrender.com/







PDF-Generator (Frontend - NextJS)

This NextJS application serves as a PDF Generator which lets the user to upload the pdf using a dropzone and then the user can preview the pages of the pdf that they uploaded. The user can also select the pages that they want to extract and then click on generate PDF to get a download link for the new pdf with extracted pages.

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.


Installation

Install pdf-generator with git:

  git clone https://github.com/ugauniyal/PDF-Generator.git
  cd PDF-Generator/pdf-app

Running Tests

To run tests, run the following command. I used enzyme to create the tests and jest for running the tests.

  npm test

Screenshots

Upload PDF

Upload PDF Dropzone Screenshot


PDF Preview

PDF Preview Screenshot


Extract pages of PDF

Extract pages of PDF Screenshot


Deployment

https://pdf-generator-three-kappa.vercel.app/

About

A pdf generator where user can upload a pdf and generate a new pdf with the pages of their choice.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors