Convert HTML files to PDF with Prince through an API.
$ goprince [--help] [--log-dir=/my/directory/] [--stdout] [--port 8080]
--help: show help--log-dir: set Gin and Prince log directory. Default /var/log/goprince--stdout: if given, Gin and Prince also log on stdout--port: set port listening on. Default 8080POST /generate/{filename}filename string: Name of the output PDF fileinput_file file: HTML file to convert (required)stylesheet file: CSS file to upload to pass to Princeoutput string (optional):
stream: returns bytes of the filefile: serves PDF file to download| Var | Description |
|---|---|
APP_ENV | dev / production |
LICENSE_FILE | Path to Prince license file |
LICENSE_KEY | Prince license hash key |
Both Prince and Gin are logged in separated files.
Logs are written in the container, in /var/log/goprince folder.
In development environment, the Docker log directory is mapped on logs/ folder by a volume in docker-compose.yml.
To build the application's docker image run:
$ make build-dev
To launch a docker container run:
$ make run-dev
To access the API browse at
http://localhost:8080/
To access the conteneur with shell
$ make sh
You can build a Docker image for your go application by running:
$ make build-prod
:warning: You need to increment number in VERSION file to increment Docker's image tag.
And to launch a docker container for the image created above we run:
$ make run-prod
Content type
Image
Digest
Size
19.6 MB
Last updated
about 8 years ago
docker pull spoon4/goprince