Giter Club home page Giter Club logo

pdf2ppt's Introduction

pdf2ppt

Convert PDF Slides to PowerPoint Presentations (PPT)

Motivation

LaTeX users can easily convert the beamer slides in PDF to PPT.

Features

  • vector graph (highest resolution) in generated PPT
  • metadata (including title, author) conversion
  • auto-detection of slide size and aspect ratio

Dependency

Technical Implementation

  1. The first step is to create SVG from PDF via pdf2svg.
  2. Due to the limitation of python-pptx, we need to convert SVG to EMF via inkscape.
  3. Insert EMF into PPT via python-pptx.

Note

python3, pdf2svg and inkscape should be in your PATH. Alternatively, --pdf2svg-path and --inkscape-path options can be used to specify their paths.

Usage

Installation

Use git to clone the repository.

git clone https://github.com/Teddy-van-Jerry/pdf2ppt.git --depth=1

If you only want the latest Python script, you can directly download the source file.

wget https://raw.githubusercontent.com/Teddy-van-Jerry/pdf2ppt/master/pdf2ppt

For non-Windows users, use make install to install the script to /usr/local/bin (which should be in your PATH variable).

Tip

Make sure you have the dependency installed.

Command Line Options

You can use pdf2ppt -h to view all options.

Quick Start

Note

If you have not installed pdf2ppt to your PATH, you need to use ./pdf2ppt in the correct directory.

Specifying the output file name.

pdf2ppt input.pdf output.pptx

Without specifying output file name. The output will be input.pptx under the same directory of input.

pdf2ppt input.pdf

Toggle verbose mode.

pdf2ppt input.pdf output.pptx --verbose

Known Issues

Transparent Background

Unfortunately, elements with transparency are not supported by the project, due to limitations of the dependency. You will receive a warning when such issues are detected, and you can copy the generated SVG manually to fix the problem. View #1 for more details.

License

Copyright Šī¸ 2023 Teddy van Jerry (Wuqiong Zhao). This project is distributed under the MIT License.

pdf2ppt's People

Contributors

teddy-van-jerry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pdf2ppt's Issues

Filters in SVG Not Exported Correctly to EMF

Problem Description
When the exported SVG contains filter, for example filter="url(#filter-remove-color)" and filter="url(#filter-color-to-alpha)", Inkscape will ignore the filters, resulting in display errors in EMF.

Problem Causes
Let's analyze the problem step by step. It is a chain of dependency issues that we can hardly mitigate in this project.

  1. Firstly, when the PDF contains some images with transparency, pdf2svg will convert them as <image /> with filters used. This behavior, unfortunately, goes down to its own dependency.
    dawbarton/pdf2svg#22
  2. When Inkscape ignores filters, the transparency is gone, resulting in black blocks which are annoying.
    https://gitlab.com/inkscape/inbox/-/issues/3858
    https://gitlab.com/inkscape/inbox/-/issues/2275
  3. As such, the generated PPT file is not accurate and requires manual editing.

Mitigation Thoughts

  1. The first thing to avoid is using transparency in creating PDF (I think you are using LaTeX with the beamer class), though this can be hard. Avoid PNG with transparency. Avoid using PDF generated from other applications (which can contain transparency somewhere you are unaware of). The alternative is to always favor TikZ, which produces better quality. Note that try to reduce the use of opacity in TikZ as well, and use pseudo-opacity, like blue!10 on a white background.
  2. I will do some checks on SVG in the pdf2ppt project to produce warnings on affected slide pages, so you can copy and paste the original SVG to PPT manually.

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.