Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfix committed Sep 20, 2020
1 parent 376020a commit fce0938
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,28 @@ All the things that are compiled are place in the `build` directory. You can ser

## Exporting in PDF

Using the built-in pdf export does not work very well. Instead :
Using the built-in pdf export does not work very well. Instead we serve the slides locally and use [decktape](https://github.com/astefanutti/decktape) to convert the HTML slides into PDF.

npm install -g puppeteer --unsafe-perm=true
npm install -g decktape
You need to be in the directory where the HTML slides are generated. And suppose the generated slides are `slides.html`

We serve locally the files with :

python3 -m http.server 8000

You can ensure you can access the slides by opening a browser and loading http://localhost:8000 . You should see your slides.

Then we use the decktape docker image to perform the export into pdf:

docker run --net=host -v `pwd`:/slides astefanutti/decktape http://localhost:8000/slides.html /tmp/slides.pdf
docker cp `docker ps -lq`:/tmp/slides.pdf .
docker rm `docker ps -lq`

This will give you the `slides.pdf` file.

I had to use this longer sequence, suggested on the decktape github repo since otherwise I got a EACCESS error when trying to save the slides with :

docker run --rm --net=host -v `pwd`:/slides astefanutti/decktape http://localhost:8000/slides.html slides.pdf

And then use `decktape`. See the [project page](https://github.com/astefanutti/decktape)

## References

Expand Down

0 comments on commit fce0938

Please sign in to comment.