Skip to content

qrafttech/pdfgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pdfgen

PDF generation API

Installation

You need node and we highly recommend installing it through a Version Manager, such as nvm. The following will install node LTS and npm

brew install nvm
nvm install --lts

We use bun to install dependencies and run the app. Use brew 🍺 to install it.

brew install oven-sh/bun/bun

Install the Javascript dependencies

bun install

Usage

Run the following command to start the server:

bun start

To start in development mode, with the server reloading on each file change, run:

bun dev

Generate a PDF

Using cURL

Send a POST request to the /generate endpoint with a JSON body containing the HTML you want to convert to a PDF.

curl -X POST "https://pdfgen.so/api/v1/generate" -H "Content-Type: application/json" -d '{"html": "<h1>Hello World</h1>"}'

The response will contain the PDF file.

PDFs are generated synchronously and are not saved to disk.

Bruno

Bruno API client collection is saved in the bruno folder. Import the collection and run it to test the API.

About

PDF generation API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published