Git Product home page Git Product logo

chm2pdf's Introduction

chm2pdf

A Python script that converts a CHM file into a single PDF file.

(c) 2007 Massimo Sandal [email protected]

(c) 2007-2008 Chris Karakas [email protected] and http://www.karakas-online.de

Usage: chm2pdf [options] input_filename [output_filename]

For all options, see chm2pdf --help

RECOMMENDED READING:

Installation:

  • download the .tar.gz
  • unzip it: "tar -xzvf chm2pdf-a.b.c.tar.gz"
  • enter the newly created directory
  • acquire root privileges
  • type "python setup.py install"

Requires:

  • python
  • chmlib. NOTE: chmlib must be configured with ./configure --enable-examples
  • pychm
  • htmldoc
  • BeautifulSoup (optional)

All of these should be in your Linux/Unix distribution repository :)

chm2pdf's People

Contributors

arnoques avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chm2pdf's Issues

chm2pdf fails if python points to python3 instead of python2.7

I have received the following error message when using your tool on a Ubuntu 18.04.3 machine with only python3 installed:

  File "/usr/bin/chm2pdf", line 341
    print '### WARNING: ' + options['titlefile'] + ' not found inside ' + filename + ' - possible spelling error.'
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('### WARNING: ' + options['titlefile'] + ' not found inside ' + filename + ' - possible spelling error.')?

As a workaround, I propose to update the shebang by explicitly stating the python version that is required, i.e., python2.7

Fails if the file has spaces in its name.

The problem is right here. I have a bunch of CHM files from a Windows machine and this script is failing with shell syntax errors.

This could be a security bug if chm2pdf is used as part of another script that accepts untrusted filenames. A string like my_file; rm -rf $HOME .chm is a legal Unix filename, and would result in unexpected code execution if it was encountered by chm2pdf.

What if this site is using this script in its implementation?

Fortunately, the fix is easy.

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.