Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

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