Package Exports
- pptx2pdf
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pptx2pdf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
pptx2pdf
Converts pptx (*.pptx, *.ppt, *.odp) to pdf and/or png OR converts pdf to png.
# install globally to use on the command-line
npm install -g pptx2pdf
# install locally to use a library
npm install --save pptx2pdf
Dependencies
pptx2pdf requires libreoffice and imagemagick and might require ghostscript.
ubuntu/debian
sudo apt install libreoffice
sudo apt install imagemagick
sudo apt install ghostscript # was NOT requiredmacos
brew cask install libreoffice
brew install imagemagick
brew install ghostscript # WAS requiredusing the command-line
$ pptx2png --help
pptx2png [options] [input-file]
Options:
--input, -i input file
--output-dir, -o where your file will be placed [default: "."]
--filename, -f override output filename
--libreoffice-bin, -l override the libreoffice path
--png, -p output png instead [boolean] [default: false]
--remove-pdf, -r delete pdf file when outputting png
[boolean] [default: false]
--help Show help [boolean]
--version Show version number [boolean]
# convert to pdf
pptx2pdf input.pptx
# convert to png
pptx2pdf input.pptx --png
# convert pdf to png
pptx2pdf input.pdfInspiration
I needed convert PowerPoint into pdf or pdf. I found the following projects:
- node-ppt2pdf (not on npm)
- ppt2png (npm)
Both require unoconv and LibreOffice (or OpenOffice) however it didn't work with the latest version of Libreoffice. I assume it was because of a older version of unoconv/libreoffice. However, the latest version of libreoffice can convert to pdf on the command-line, please see below.
libreoffice --headless \
--invisible \
--convert-to pdf \
--outdir <outputDir> \
inputPath