Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vikramsamak/html-to-pdf-microservice

A simple microservice that converts HTML content to PDF using Puppeteer.
https://github.com/vikramsamak/html-to-pdf-microservice

api-rest expressjs htmltopdf microservice nodejs puppeteer

Last synced: 2 days ago
JSON representation

A simple microservice that converts HTML content to PDF using Puppeteer.

Awesome Lists containing this project

README

        

# HTML to PDF Microservice

A simple microservice that converts HTML content to PDF using Puppeteer.

## Getting Started

### Prerequisites

- Node.js (v14 or later)
- npm (v7 or later)

### Installation

1. Clone the repository:

```bash
git clone https://github.com/vikramsamak/html-to-pdf-microservice.git

2. Navigate to the project directory:

```bash
cd html-to-pdf-microservice

3. Install dependencies:

```bash
npm install

### Usage

```bash
npm run dev
```

### Examples

The `examples` folder contains illustrative code snippets or projects to demonstrate the usage of the main codebase.

- [Converting HTML Code into pdf](./examples/fromCode.js): Illustrates how to convert HTML code to a PDF file using the microservice. This example demonstrates the usage of the /convert-from-code endpoint.

- [Converting HTML File into pdf](./examples/fromFile.js):Demonstrates the process of converting an HTML file to a PDF using the microservice. This example showcases the usage of the /convert-from-file endpoint with file upload.

Feel free to explore these examples to better understand how to use the main functionalities provided by this project.

### Dependencies

Express.js: Web server framework

Puppeteer: Headless Chrome Node API for PDF generation

### Contributing

Feel free to contribute by opening issues or pull requests.