Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
Kalimuthu Selvaraj 3642b59b9f Renamed package name. 5 роки тому
test Fix require error fix on test.js 5 роки тому
.gitignore Updated windows path to linux. 5 роки тому
.travis.yml Added timeout for code cover and script install imagemagik. 5 роки тому
README.md Renamed package name. 5 роки тому
index.js Reduced sample file size. 5 роки тому
package-lock.json Version 1.0.0 - add sweet badges 5 роки тому
package.json Renamed package name. 5 роки тому

README.md

document-convert

Build Status Coverage Status

Converts .ppt .pptx .odp and .key file to pdf or/and image(png, jpg, jpeg and etc..)

Dependencies

Please install libreoffice, imagemagick and might required ghostscript for Mac os (Note: Please do restart your machine after installed all required software.)

LibreOffice test

libreOfficeInstallationPath --headless --convert-to pdf --outdir outputDir sourceFile(test.pdf),

LibreOffice Installation Path

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

Imagemagic test

convert -verbose -resize 1200 -density 200 test.pdf test-%d.png(%d inserts the images scene number)

Usage Example

// Import convert module
const document = require("file-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("res", res); // Success or Error
  })
  .catch((e) => {
    console.log("e", e);
  });