Changeset 1421

Show
Ignore:
Timestamp:
10/22/06 01:15:15 (2 years ago)
Author:
athomas
Message:

PageToPdfPlugin:

Any configuration items in the [pagetopdf] section will be passed through to
htmldoc as command line arguments. Closes #664 and #837 (override charset and size, respectively).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pagetopdfplugin/0.10/pagetopdf/pagetopdf.py

    r1386 r1421  
    2525        os.close(pfile) 
    2626        os.environ["HTMLDOC_NOCGI"] = 'yes' 
    27         os.system('htmldoc --charset %s --webpage --format pdf14 --left 1.5cm --right 1.5cm --top 1.5cm --bottom 1.5cm %s -f %s' % (codepage.replace('iso-', ''), hfilename, pfilename)) 
     27        htmldoc_args = { 'webpage': None, 'format': 'pdf14', 'left': '1.5cm', 
     28                         'right': '1.5cm', 'top': '1.5cm', 'bottom': '1.5cm', 
     29                         'charset': codepage.replace('iso-', '')} 
     30        htmldoc_args.update(dict(self.env.config.options('tracpdf'))) 
     31        args_string = ' '.join(['--%s %s' % (arg, value or '') for arg, value 
     32                                in htmldoc_args.iteritems()]) 
     33        self.env.log.debug(args_string) 
     34        os.system('htmldoc %s %s -f %s' % (args_string, hfilename, pfilename)) 
    2835        out = open(pfilename, 'rb').read() 
    2936        os.unlink(pfilename)