Lucientes is a simple web service for converting HTML files into high quality images.
This project allows users to convert HTML content into images in formats like PNG, JPEG, or WEBP, facilitating easier sharing and accessibility of digital information. It is built with Node.js, Express, and Puppeteer to provide a seamless and efficient service.
Lucientes is developed by the Spanish startup Maximiliana to support the "Atentamente, tu nieto" campaign. Our goal is to bridge the digital gap for elderly people by providing an easy-to-use mobile experience. Maximiliana creates innovative solutions to connect the elderly with their families, ensuring everyone can communicate effortlessly.
- Convert HTML to PNG, JPEG, or WEBP images.
- Simple and intuitive API.
- Built with Node.js, Express, and Puppeteer.
Make sure you have Docker installed on your system.
-
Pull the Docker image from DockerHub:
docker pull maximiliana/lucientes
-
Run the Docker container:
docker run -p 8080:3000 --env PORT=3000 maximiliana/lucientes
To convert an HTML file to an image, you can use tools like curl
or Postman. Below are examples using curl
.
-
Convert HTML to PNG:
curl -X POST http://localhost:8080/html-to-image \ -F "file=@path/to/your/test.html" \ -F "width=1920" \ -F "height=1080" \ -F "deviceScaleFactor=2" \ -F "format=png" \ --output output.png
-
Convert HTML to JPEG:
curl -X POST http://localhost:8080/html-to-image \ -F "file=@path/to/your/test.html" \ -F "width=1920" \ -F "height=1080" \ -F "deviceScaleFactor=2" \ -F "format=jpeg" \ --output output.jpeg
-
Convert HTML to WEBP:
curl -X POST http://localhost:8080/html-to-image \ -F "file=@path/to/your/test.html" \ -F "width=1920" \ -F "height=1080" \ -F "deviceScaleFactor=2" \ -F "format=webp" \ --output output.webp
PORT
: The port on which the server will run (default is 3000).
The project is named "Lucientes" after the famous Spanish painter Francisco de Goya y Lucientes, known for his profound impact on the art world with his powerful and innovative works.
We welcome contributions! Please feel free to submit issues and pull requests to help improve the project.
This project is licensed under the GPL 2.1 License - see the LICENSE file for details.
Developed with ❤️ in Zaragoza for the grandpas of the world.