Go to file
Yamamoto, Hirotaka e2b5232083
Use GITHUB_TOKEN to push images
2021-03-27 09:46:34 +09:00
.github/workflows Use GITHUB_TOKEN to push images 2021-03-27 09:46:34 +09:00
converter Run multiple soffice instances safely 2020-10-23 02:08:45 +00:00
docs Export prometheus metrics 2020-10-22 12:26:04 +00:00
sub Export prometheus metrics 2020-10-22 12:26:04 +00:00
testdata Add GitHub Actions workflows 2020-10-22 01:55:36 +00:00
.dockerignore Initial commit 2020-10-20 23:09:12 +00:00
.gitignore Add tests for HTTP handler 2020-10-22 00:27:53 +00:00
CHANGELOG.md Update CHANGELOG for v0.0.2 2020-10-23 02:20:04 +00:00
Dockerfile Add tests for HTTP handler 2020-10-22 00:27:53 +00:00
LICENSE Initial commit 2020-10-20 23:09:12 +00:00
Makefile Add GitHub Actions workflows 2020-10-22 01:55:36 +00:00
README.md Export prometheus metrics 2020-10-22 12:26:04 +00:00
go.mod Export prometheus metrics 2020-10-22 12:26:04 +00:00
go.sum Export prometheus metrics 2020-10-22 12:26:04 +00:00
main.go Initial commit 2020-10-20 23:09:12 +00:00

README.md

CI

pdf-converter

This directory contains a Dockerfile to convert files to PDF using LibreOffice.

Image registries

Usage

Run conversion server

$ docker run -d --rm -p 127.0.0.1:8080:8080/tcp --tmpfs /tmp ghcr.io/ymmt2005/pdf-converter

Try it using curl:

$ curl -o result.pdf -F file=@/path/to/your.pptx http://localhost:8080/convert

See docs/api.md for the HTTP API.

Run LibreOffice directly

To convert $HOME/work/foo.pptx directly,

$ sudo chown -R 10000:10000 $HOME/work
$ docker run -it --rm --tmpfs /tmp -v $HOME/work:/home/libre \
    ghcr.io/ymmt2005/pdf-converter soffice --headless --convert-to pdf /home/libre/foo.pptx

Metrics

pdf-converter exports metrics for Prometheus at /metrics endpoint.

Read docs/metrics.md for details.

pdf-converter command reference

Run HTTP server to convert Office files to PDF

Usage:
  pdf-converter WORKDIR [flags]

Flags:
  -h, --help                        help for pdf-converter
      --listen string               bind address of the HTTP server (default ":8080")
      --logfile string              Log filename
      --logformat string            Log format [plain,logfmt,json]
      --loglevel string             Log level [critical,error,warning,info,debug]
      --max-convert-time duration   the maximum time allowed for conversion (default 3m0s)
      --max-length int              the maximum length of the uploaded contents (default 1073741824)
      --max-parallel int            the maximum parallel conversions.  0 for unlimited parallelism