Browse Source

Test files changed and updated readme.

tags/v1.0.0
Kalimuthu Selvaraj 5 years ago
parent
commit
bc8ae47974

+ 1
- 1
README.md View File

document document
.convert(options) .convert(options)
.then((res) => { .then((res) => {
console.log("Res1", res);
console.log("res", res); // Success or Error
}) })
.catch((e) => { .catch((e) => {
console.log("e", e); console.log("e", e);

+ 3
- 3
convert.js View File



const proc = spawn(_cmd, _args); const proc = spawn(_cmd, _args);


proc.stdout.on("data", (data) => {
// console.log("stdout", data.toString());
});
// proc.stdout.on("data", (data) => {
// // console.log("stdout", data.toString());
// });


proc.stderr.on("error", function (err) { proc.stderr.on("error", function (err) {
reject(err); reject(err);

BIN
test/source/Metro_Style.pdf View File


BIN
test/source/Metro_Style.pptx View File


BIN
test/source/file_example_PPT_250kB.pdf View File


BIN
test/source/file_example_PPT_250kB.ppt View File


+ 3
- 3
test/test.js View File

describe("Convert files to pdf or/and image", function () { describe("Convert files to pdf or/and image", function () {
const options = { const options = {
libreofficeBin: "C:\\Program Files\\LibreOffice\\program\\sooffice.exe", libreofficeBin: "C:\\Program Files\\LibreOffice\\program\\sooffice.exe",
sourceFile: `${global.appRoot}/source/Metro_Style.pptx`,
sourceFile: `${global.appRoot}/source/file_example_PPT_250kB.ppt`,
outputDir: `${global.appRoot}/files/`, outputDir: `${global.appRoot}/files/`,
img: true, img: true,
}; };
}); });


it("should convert pdf to image", function () { it("should convert pdf to image", function () {
options.sourceFile = `${global.appRoot}/source/Metro_Style.pdf`;
options.sourceFile = `${global.appRoot}/source/file_example_PPT_250kB.pdf`;
options.outputDir = `${global.appRoot}/files/`; options.outputDir = `${global.appRoot}/files/`;
options.reSize = 800; options.reSize = 800;
document.convert(options).then((res) => { document.convert(options).then((res) => {
}); });


it("should convert pdf only", function (done) { it("should convert pdf only", function (done) {
options.sourceFile = `${global.appRoot}/source/Metro_Style.pptx`;
options.sourceFile = `${global.appRoot}/source/file_example_PPT_250kB.ppt`;
options.img = false; options.img = false;
document.convert(options).then((res) => { document.convert(options).then((res) => {
expect(res).to.equal("Success"); expect(res).to.equal("Success");

Loading…
Cancel
Save