Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/vikramsamak/html-to-pdf-microservice
- Owner: vikramsamak
- Created: 2023-12-24T10:19:32.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-04T05:18:47.000Z (about 1 year ago)
- Last Synced: 2024-02-04T15:31:34.969Z (about 1 year ago)
- Topics: api-rest, expressjs, htmltopdf, microservice, nodejs, puppeteer
- Language: JavaScript
- Homepage: https://html-to-pdf-microservice.onrender.com
- Size: 156 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.git2. Navigate to the project directory:
```bash
cd html-to-pdf-microservice3. 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.