|  | il y a 5 ans | |
|---|---|---|
| test | il y a 5 ans | |
| .gitignore | il y a 5 ans | |
| .travis.yml | il y a 5 ans | |
| README.md | il y a 5 ans | |
| convert.js | il y a 5 ans | |
| package-lock.json | il y a 5 ans | |
| package.json | il y a 5 ans | |
| sample.js | il y a 5 ans | |
Converts .ppt .pptx .odp and .key file to pdf or/and image(png, jpg, jpeg and etc..)
Please install libreoffice, imagemagick and might required ghostscript for Mac os (Note: Please do restart your machine after installed all required software.)
libreOfficeInstallationPath --headless --convert-to pdf --outdir outputDir sourceFile(test.pdf),
Windows
C:\\Program Files\\LibreOffice\\program\\soffice.exe (or)
C:\\Program Files (x86)\\LibreOffice\\program\\soffice.exe (or)
C:\\Program Files (x86)\\LIBREO~1\\program\\soffice.exe
Ubuntu
/usr/bin/libreoffice (or)
/usr/bin/soffice
Mac OS
/Applications/LibreOffice.app/Contents/MacOS/soffice
convert -verbose -resize 1200 -density 200 test.pdf test-%d.png(%d inserts the images scene number)
// Import convert module
const document = require("./convert");
const options = {
  libreofficeBin: "C:\\Program Files\\LibreOffice\\program\\soffice.exe",
  sourceFile: "C:\\convert-pdf-img\\sample.pptx", // .ppt, .pptx, .odp, .key and .pdf
  outputDir: "C:\\convert-pdf-img\\output",
  img: false,
  imgExt: "jpg", // Optional and default value png
  reSize: 800, //  Optional and default Resize is 1200
  density: 120, //  Optional and default density value is 120
};
// Convert document to pdf and/or image
document
  .convert(options)
  .then((res) => {
    console.log("Res1", res);
  })
  .catch((e) => {
    console.log("e", e);
  });