Skip to content

Converts documents to PDF using libreoffice running in a Docker container.

License

Notifications You must be signed in to change notification settings

jidel/docker-to-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker toPDF

Converts documents to PDF using libreoffice running in a Docker container without the need to install libreoffice and its dependencies on your host system. Uses the UNIX way of reading from stdin and outputting to stdout, so no volume mounting is needed.

Getting Started

Prerequisites

You need to have docker installed on your system. For instructions on how to install, see here:

Install

Image is not yet published to Dockerhub yet, you have to build it locally:

$ docker build -t doctopdf .

Usage

Using the --rm flag ensures that the container is removed after use and does not clutter your docker with unused containers.

$ docker run --rm -i doctopdf < Document.docx > Document.pdf

Alternatively, you could use the cat command to pipe the input file into the container:

$ cat Document.docx | docker run --rm -i doctopdf > Document.pdf

Custom Fonts

The image comes with the default debian fonts as well as the non-default Microsoft fonts like Arial or Times New Roman by installing the ttf-mscorefonts-installer package.

Additional TrueType fonts can be placed into the fonts folder. They are copied into the image on build and can then be used in the PDF creation process.

Acknowledgments

Thanks go to Vlad Hulobiev as the idea is heavily based on his work.

About

Converts documents to PDF using libreoffice running in a Docker container.

Topics

Resources

License

Stars

Watchers

Forks