Convert ppt to image (png,jpg).
If you want convert powerpoint files to png or jpg images, you can do it with this script.
The package requires the following software to be installed:
- LibreOffice-dev
- ImageMagick
- pdfinfo
Minimum node version: 18
`npm install ppt-png`
Debian/Ubuntu:
`sudo apt install libreoffice-dev imagemagick poppler-utils`
Mac:
`brew install imagemagick poppler ghostscript`
import Converter from 'ppt-png'
const converter = Converter.create({
files: ['test/OPW 733 Tienduizend redenen.ppt'],
output: 'output/'
});
const result = converter.convert();
files: Array with the files.
output: Output folder.
invert: Invert the colors, default is false
;
greyscale: Greyscale the colors, default is false
;
deletePdfFile: Delete the pdf file after converting, default is true
.
outputType: Output type, default is png
, but jpg
is also possible.
documentConvert: Overrule the document convert command, default is 'libreoffice --headless --convert-to pdf --outdir'
density: Density setting to convert the PDF to image at, defaults to 96 DPI
width: Width of the output images if density is not used
height: Height of the output images if density is not used
logLevel: Set the log level, default is 1
.
npm test
This will run all the tests in the test folder with mocha.
If you only want to check the eslint rules, just run.
npm run lint