html2pdf is a small microservice build using the lumen framework. It utilizes wkhtmltopdf for generating pdfs.
The microservice comes as a docker image, and it can be hosted on services that support docker images. The demo is serverless and run on Google Cloud Run.
- Preview PDF from HTML - Click Here
- Preview PDF from URL - Click Here
- Download PDF from HTML - Click Here
- Download PDF from URL - Click Here
- Run the docker image
docker run -it -rm -p 9091:80 gcr.io/akki-ca/html2pdf
- Visit
localhost:9091/status
You can also add the service to your docker-composer file.
html2pdf:
image: gcr.io/akki-ca/html2pdf
ports:
- "9091:80"
Get the status of the microservice
{
"message": "Request successfully completed."
}
Name | Type | Nullable | Description |
---|---|---|---|
url | url | Y | The url that needs to be converted to pdf. |
html | string | Y/N | It is required if url is null or not present. |
options | array | Y | wkhtmltopdf options - ref here |
preview | boolean | Y | If set to 1 you will return a preview of the generated pdf |
filename | string | Y | Set the filename of the pdf that will be downloaded |
If the request is successful the response will return a preview of the pdf file or as a download depending on the request parameters.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.