Creates a Reveal.js HTML slideshow from a PDF document
For more info, see blog post
pdftoppm
- extracts PDF pages as images ; usually packed as part of poppler or poppler-utils on your distropngquant
- compresses PNG ; available in package managerssed
- text manipulation with filestree
- optionally required if index is to be generated
- To convert a single PDF to HTML slideshow,
script.sh -p PDF
- To convert a bunch of folders with a PDF,
script_batch.sh -p FOLDER
- Parameters:
-p PATH
: Path to PDF or folder-f
: Force re-processing. Otherwise it will skip folders withindex.html
-i
: Forscript_batch.sh
generates anindex.html
in root folder usingtree
script.sh
does all of the work- To edit the final reveal.js template, customise
template.html
- You might need to configure location of
reveal.js
in the template, the default is set to work for example in this repo - You use it as
script.sh PDF_Path Output_path
- It will extract PNG in output folder, copy template as
index.html
, and insert links to each image in the HTML - See demo at https://harshp.com/pdf2slideshow/example
So given a PDF and a PATH, the output will be:
PATH
|-- PDF
|-- index.html + pngs
If you have a nested folder structure with each PDF being in its own folder, then the script script_batch.sh
can process the entire folder and generate HTML in each folder.
So given an input folder such as:
root
|-- folderA
|-- PDF
|-- folderB
|-- PDF
The output will be:
root
|-- index.html (if -i parameter is passed)
|-- folderA
|-- PDF
|-- index.html + pngs
|-- folderB
|-- PDF
|-- index.html + pngs
- ShellCheck as bash linter
- tested and confirmed over presentations output
MIT, see License file for full text