Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

5 роки тому
5 роки тому
5 роки тому
5 роки тому
5 роки тому
5 роки тому
5 роки тому
5 роки тому
5 роки тому
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # document-convert
  2. [![Build Status](https://travis-ci.com/kalimuthu-selvaraj/document-convert.svg?branch=master)](https://travis-ci.com/kalimuthu-selvaraj/document-convert)
  3. [![Coverage Status](https://coveralls.io/repos/github/kalimuthu-selvaraj/document-convert/badge.svg?branch=master)](https://coveralls.io/github/kalimuthu-selvaraj/document-convert?branch=master)
  4. Converts `.ppt` `.pptx` `.odp` and `.key` file to `pdf or/and image(png, jpg, jpeg and etc..)`
  5. ## Dependencies
  6. 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
  7. **(Note: Please do restart your machine after installed all required software.)**
  8. ## LibreOffice test
  9. libreOfficeInstallationPath --headless --convert-to pdf --outdir outputDir sourceFile(test.pdf),
  10. ## LibreOffice Installation Path
  11. Windows
  12. ```
  13. C:\\Program Files\\LibreOffice\\program\\soffice.exe (or)
  14. C:\\Program Files (x86)\\LibreOffice\\program\\soffice.exe (or)
  15. C:\\Program Files (x86)\\LIBREO~1\\program\\soffice.exe
  16. ```
  17. Ubuntu
  18. ```
  19. /usr/bin/libreoffice (or)
  20. /usr/bin/soffice
  21. ```
  22. Mac OS
  23. ```
  24. /Applications/LibreOffice.app/Contents/MacOS/soffice
  25. ```
  26. ## Imagemagic test
  27. convert -verbose -resize 1200 -density 200 test.pdf test-%d.png(%d inserts the images `scene number`)
  28. ## Usage Example
  29. ```javascript
  30. // Import convert module
  31. const document = require("./convert");
  32. const options = {
  33. libreofficeBin: "C:\\Program Files\\LibreOffice\\program\\soffice.exe",
  34. sourceFile: "C:\\convert-pdf-img\\sample.pptx", // .ppt, .pptx, .odp, .key and .pdf
  35. outputDir: "C:\\convert-pdf-img\\output",
  36. img: false,
  37. imgExt: "jpg", // Optional and default value png
  38. reSize: 800, // Optional and default Resize is 1200
  39. density: 120, // Optional and default density value is 120
  40. };
  41. // Convert document to pdf and/or image
  42. document
  43. .convert(options)
  44. .then((res) => {
  45. console.log("Res1", res);
  46. })
  47. .catch((e) => {
  48. console.log("e", e);
  49. });
  50. ```