Selaa lähdekoodia

Updated .readme and test case.

master
Kalimuthu Selvaraj 4 vuotta sitten
vanhempi
commit
feae87dbe9
3 muutettua tiedostoa jossa 13 lisäystä ja 7 poistoa
  1. 9
    7
      README.md
  2. 1
    0
      package.json
  3. 3
    0
      test/test.js

+ 9
- 7
README.md Näytä tiedosto

@@ -2,19 +2,20 @@

[![Build Status](https://travis-ci.com/kalimuthu-selvaraj/file-convert.svg?branch=master)](https://travis-ci.com/kalimuthu-selvaraj/file-convert) [![Coverage Status](https://coveralls.io/repos/github/kalimuthu-selvaraj/file-convert/badge.svg?branch=master)](https://coveralls.io/github/kalimuthu-selvaraj/file-convert?branch=master)

Converts `.ppt` `.pptx` `.odp` and `.key` file to `pdf or/and image(png, jpg, jpeg and etc..)`
(new feature) `disableExtensionCheck` is `true` then converts any file(supported by libre office) to `pdf or/and image(any format)`

`disableExtensionCheck` is `false` then converts only `.ppt` `.pptx` `.odp` and `.key` file to `pdf or/and image(png, jpg, jpeg and etc..)`

## Dependencies

Please install [libreoffice](https://www.libreoffice.org/), [imagemagick](https://www.imagemagick.org/script/index.php) and might required [ghostscript](https://www.ghostscript.com/) for Mac os
**(Note: Please do restart your machine after installed all required software.)**

###IMPORTANT
Make sure you install libreoffice to the USER you launch nodejs with and that this user HAS a home directory!
try to convert a file from inside that USER to properly test!
in case you install directly from libreoffice website,
MAKE SURE you use the ./install script that comes inside the tar.gz inside the USER!

###IMPORTANT
Make sure you install libreoffice to the USER you launch nodejs with and that this user HAS a home directory!
try to convert a file from inside that USER to properly test!
in case you install directly from libreoffice website,
MAKE SURE you use the ./install script that comes inside the tar.gz inside the USER!

## LibreOffice test

@@ -61,6 +62,7 @@ const options = {
imgExt: "jpg", // Optional and default value png
reSize: 800, // Optional and default Resize is 1200
density: 120, // Optional and default density value is 120
disableExtensionCheck: true, // convert any files to pdf or/and image
};

// Convert document to pdf and/or image

+ 1
- 0
package.json Näytä tiedosto

@@ -9,6 +9,7 @@
"coverage": "nyc npm run test"
},
"keywords": [
"libreoffice file convert to pdf or/and image",
"ppt to pdf",
"pptx to pdf",
"keynote to pdf",

+ 3
- 0
test/test.js Näytä tiedosto

@@ -29,6 +29,7 @@ describe("Convert files to pdf or/and image", function () {
});

it("should convert pdf to image", function () {
options.libreofficeBin = "/usr/bin/libreoffice";
options.sourceFile = `${global.appRoot}/source/file_example.pdf`;
options.outputDir = `${global.appRoot}/files/`;
options.reSize = 800;
@@ -38,6 +39,7 @@ describe("Convert files to pdf or/and image", function () {
});

it("should convert pdf only", function (done) {
options.libreofficeBin = "/usr/bin/libreoffice";
options.sourceFile = `${global.appRoot}/source/file_example.pptx`;
options.img = false;
document.convert(options).then((res) => {
@@ -47,6 +49,7 @@ describe("Convert files to pdf or/and image", function () {
});

it("should convert without resize, density and imgExt", function () {
options.libreofficeBin = "/usr/bin/libreoffice";
options.img = true;
document.convert(options).then((res) => {
expect(res).to.equal("Success");

Loading…
Peruuta
Tallenna