Giter VIP home page Giter VIP logo

pptx2pdf's Introduction

pptx2pdf

Converts pptx (*.pptx, *.ppt, *.odp) to pdf and/or png OR converts pdf to png.

# install globally to use on the command-line
npm install -g pptx2pdf

# install locally to use a library
npm install --save pptx2pdf

Dependencies

pptx2pdf requires libreoffice and imagemagick and might require ghostscript.

ubuntu/debian

sudo apt install libreoffice
sudo apt install imagemagick
sudo apt install ghostscript # was NOT required

macos

brew cask install libreoffice
brew install imagemagick
brew install ghostscript # WAS required

using the command-line

$ pptx2png --help

pptx2png [options] [input-file]

Options:
  --input, -i            input file
  --output-dir, -o       where your file will be placed           [default: "."]
  --filename, -f         override output filename
  --libreoffice-bin, -l  override the libreoffice path
  --png, -p              output png instead           [boolean] [default: false]
  --remove-pdf, -r       delete pdf file when outputting png
                                                      [boolean] [default: false]
  --help                 Show help                                     [boolean]
  --version              Show version number                           [boolean]
 
# convert to pdf 
pptx2pdf input.pptx

# convert to png 
pptx2pdf input.pptx --png

# convert pdf to png
pptx2pdf input.pdf

Inspiration

I needed convert PowerPoint into pdf or pdf. I found the following projects:

Both require unoconv and LibreOffice (or OpenOffice) however it didn't work with the latest version of Libreoffice. I assume it was because of a older version of unoconv/libreoffice. However, the latest version of libreoffice can convert to pdf on the command-line, please see below.

libreoffice --headless \
--invisible \
--convert-to pdf \
--outdir <outputDir> \
inputPath

pptx2pdf's People

Contributors

jbastias avatar

Stargazers

Hariharan avatar Rayyan avatar feilong avatar Lerr1uqs avatar Syakirin Amin avatar Juan Delgadillo avatar Webdesign29 avatar Devesh Chaudhari avatar liu avatar  avatar Houfeng avatar luoye avatar Charlie Page avatar

Watchers

 avatar James Cloos avatar

pptx2pdf's Issues

Potential command injection bug in pptx2pdf

Hi,

We would like to report a potential security vulnerability.
The bug is introduced because the package-exported method run() fails to sanitize its parameter and lets it flow into a sensitive command execution API.

Here is the proof of concept.

const p2p = require("../packages/node_modules/pptx2pdf")
p2p.run("touch rce") // a file named rce will be created

Please consider fixing it. thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.