Sign inSign up

ndolestudio/dompdf-api

By ndolestudio

•Updated 30 days ago

This is an HTTP API wrapper around the dompdf library which converts HTML to PDF.

Image
Web servers
0

3.9K

ndolestudio/dompdf-api repository overview

⁠dompdf API

Build GitHub contributors GitHub license Docker Pulls

This project provides an HTTP API wrapper around the dompdf⁠ library which converts HTML to PDF. The API is created using the Laravel framework, and you can protect the API using the basic HTTP authentication scheme⁠.

⁠Docker Setup

Run the docker container using the command below

docker run -p 8000:80 ndolestudio/dompdf-api

Make an HTTP request to convert an HTML string into a PDF file called document.pdf

curl -X POST -d '<h1>Hello World</h1>' http://localhost:8000 --output document.pdf

⁠Authentication

If you want to protect the API with basic auth, you can set the AUTH_USERNAME and AUTH_PASSWORD environment variables when running the docker container

docker run -p 8000:80 \
      --env AUTH_USERNAME="username" \
      --env AUTH_PASSWORD="password" \
      ndolestudio/dompdf-api

NOTE: You must now set the username and password when making requests to the API

## username:password in base64 is dXNlcm5hbWU6cGFzc3dvcmQ=
curl  -X POST -d '<h1>Hello World</h1>' \
      -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
      http://localhost:8000 --output document.pdf

⁠Security Vulnerabilities

If you discover a security vulnerability within the dompdf-api service, please send an e-mail to Acho Arnold via [email protected]⁠. All security vulnerabilities will be promptly addressed.

⁠License

dompdf-api is an open-sourced software licensed under the MIT license⁠.

Tag summary

Content type

Image

Digest

sha256:1780e45ef…

Size

258.7 MB

Last updated

30 days ago

docker pull ndolestudio/dompdf-api