Skip to content

GoodPie/generate-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Generation Service

This is a simple PDF generation service built with Node.js, Express, and Puppeteer. It exposes an API endpoint that accepts HTML content and a title, and returns a PDF document.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Node.js
  • npm or yarn

Installing

  1. Clone the repository:
git clone <repository_url>
  1. Navigate to the project directory:
cd pdf_generation
  1. Install the dependencies:
npm install

or

yarn install

Running the Application

Start the server:

node app.js

The server will start on port 4000. You can access it at http://localhost:4000.

API Usage

Generate PDF

Send a POST request to http://localhost:4000/generate_pdf with a JSON body containing title and html fields. The html field should contain the HTML content you want to convert to PDF.

Example:

{
  "title": "Hello World",
  "html": "<h1>Hello World</h1>"
}

The server will return a PDF document.

Built With

License

This project is licensed under the MIT License.

About

Generates a PDF using puppeteer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published