Skip to content

sbitio/docker-wkhtmltox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-wkhtmltox

DockerHub Badge

This docker container lets you run wkhtmltopdf in a docker container.

Building the image

docker build .

Using the image

docker run -v $(pwd):/tmp sbitio/wkhtmltox https://sbit.io /tmp/output.pdf
# For wkhtmltoimage:
docker run -v $(pwd):/tmp --entrypoint wkhtmltoimage sbitio/wkhtmltox https://sbit.io /tmp/output.png

The mounted volume can be used to send local html files and to save the output.

Using as a service

We leverage gogap/go-wkhtmltox to provide an as-a-service container on tag aas-latest:

docker run -d --rm --name wkhtmltox sbitio/wkhtmltox:aas-latest
curl -s -X POST \
  "http://$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' wkhtmltox):8080/v1/convert" \
  -H 'accept-encoding: gzip' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{
    "to" : "image",
    "converter":{
      "uri": "https://sbit.io"
    },
	  "template": "binary"
  }' --compressed -o sbit.jpg
docker stop wkhtmltox

Authors and Contributors

This image was built at sbit.io.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published