File chm2pdf-python3.patch of Package chm2pdf

--- chm2pdf.orig	(original)
+++ chm2pdf	(refactored)
@@ -21,6 +21,8 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 '''
 
+from __future__ import absolute_import
+from __future__ import print_function
 import chm.chm as chm
 import sys
 import sgmllib
@@ -338,10 +340,10 @@
                 output_titlefile = CHM2PDF_WORK_DIR + os.sep + options['titlefile']
 
     if not options['titlefile']=='' and not output_titlefile:
-        print '### WARNING: ' + options['titlefile'] + ' not found inside ' + filename + ' - possible spelling error.'
-        print '### You can check it if you do  \'' + sys.argv[0] + ' --extract-only\','
-        print '### then have a look at the files in  ' + CHM2PDF_ORIG_DIR + '.'
-        print '### Option \'--titlefile ' + options['titlefile'] + '\' ignored'
+        print('### WARNING: ' + options['titlefile'] + ' not found inside ' + filename + ' - possible spelling error.')
+        print('### You can check it if you do  \'' + sys.argv[0] + ' --extract-only\',')
+        print('### then have a look at the files in  ' + CHM2PDF_ORIG_DIR + '.')
+        print('### Option \'--titlefile ' + options['titlefile'] + '\' ignored')
         options['titlefile'] = ''
 
 
@@ -373,7 +375,7 @@
         page_filename = re.sub('%20',' ',page_filename)
         
         if options['verbose']=='--verbose' and options['verbositylevel']=='high' and options['dontextract'] == '':
-            print "Correcting " + page_filename
+            print("Correcting " + page_filename)
 
  
         if os.path.exists(page_filename) and (options['titlefile'] == '' or not options['titlefile'] in url):
@@ -425,25 +427,25 @@
     if options['dontextract'] == '':
         # Correct links to files in the local collection.
         if options['verbose']=='--verbose' and options['verbositylevel']=='low':
-            print 'Correcting links in the HTML files...'
+            print('Correcting links in the HTML files...')
     
         if options['verbose']=='--verbose' and options['verbositylevel']=='high':
-            print '############### 1st pass ###############'
+            print('############### 1st pass ###############')
         for match_string in  match_strings:
             replace_string = replace_garbled_strings[match_strings.index(match_string)]
             if options['verbose']=='--verbose' and options['verbositylevel']=='high':
-                print "match " + match_string + ' ' + "and replace it with " + replace_string
+                print("match " + match_string + ' ' + "and replace it with " + replace_string)
         if options['verbose']=='--verbose' and options['verbositylevel']=='high':
-            print
+            print()
             
         if options['verbose']=='--verbose' and options['verbositylevel']=='high':
-            print '############### 2nd pass ###############'
+            print('############### 2nd pass ###############')
         for match_string in  replace_garbled_strings:
             replace_string = replace_strings[replace_garbled_strings.index(match_string)]
             if options['verbose']=='--verbose' and options['verbositylevel']=='high':
-                print "match " + match_string + ' ' + "and replace it with " + replace_string
+                print("match " + match_string + ' ' + "and replace it with " + replace_string)
         if options['verbose']=='--verbose' and options['verbositylevel']=='high':
-            print
+            print()
             
         for filename in htmlout_filenames:
             
@@ -487,7 +489,7 @@
     # ...otherwise continue with PDF generation.
 
     if options['verbose']=='--verbose' and options['verbositylevel']=='low':
-        print 'Producing the PDF from the '+str(c)+' individual HTML files...'
+        print('Producing the PDF from the '+str(c)+' individual HTML files...')
 
     htmldoc_opts = ''
     # print options
@@ -582,136 +584,136 @@
             elif key=='webpage': htmldoc_opts += ' ' + value
            
     if options['verbose']=='--verbose' and options['verbositylevel']=='high':
-        print 'htmldoc' + htmldoc_opts + ' ' + htmlout_filename_list + " -f "+ outputfilename + " > /dev/null"
+        print('htmldoc' + htmldoc_opts + ' ' + htmlout_filename_list + " -f "+ outputfilename + " > /dev/null")
     exit_value=os.system ('htmldoc' + htmldoc_opts + ' ' + htmlout_filename_list + " -f "+ outputfilename + " > /dev/null")
 
     if exit_value != 0:
-        print 'Something wrong happened when launching htmldoc.'
-        print 'exit value: ',exit_value
-        print 'Check if output exists or if it is good.'
+        print('Something wrong happened when launching htmldoc.')
+        print('exit value: ',exit_value)
+        print('Check if output exists or if it is good.')
     else: 
-        print 'Written file ' + outputfilename
-    print 'Done.'    
+        print('Written file ' + outputfilename)
+    print('Done.')    
 
 def usage (name):
-    print 'Usage:'
-    print "\t%s [options] input_filename [output_filename]" % name
-    print
-    print 'Options:'
-    print
-    print '\t--beautifulsoup\n\t\tCorrect the HTML code of the pages before converting them to PDF. The BeautifulSoup package (see http://www.crummy.com/software/BeautifulSoup/) needs to be installed.'
-    print '\t--bodycolor color\n\t\tSpecifies the background color for all pages.'
-    print '\t--bodyfont {courier,helvetica,monospace,sans,serif,times}. Default is times.'
-    print '\t--bodyimage filename.{bmp,gif,jpg,png}'
-    print '\t--book\n\t\tSpecifies that the HTML sources are structured (headings, chapters, etc.).'
-    print '\t--bottom margin{in,cm,mm}\n\t\tSpecifies the bottom margin in points (no suffix or ##pt), inches  (##in),  centimeters  (##cm),  or millimeters (##mm).'
-    print '\t--browserwidth pixels\n\t\tSee http://www.htmldoc.org/newsgroups.php?ghtmldoc.general+v:3465'
-    print '\t--charset {cp-874...1258,iso-8859-1...8859-15,koi8-r}\n\t\tSpecifies the ISO character set to use for the output.'
-    print '\t--color\n\t\tSpecifies that PDF output should be in color.'
-    print '\t--compression[=level]\n\t\t'
-    print '\t--continuous\n\t\tSpecifies  that  the  HTML  sources are unstructured (plain web pages).\n\t\tNo page breaks are inserted between each file or URL in the output.'
-    print '\t--cookies \'name="value with space"; name=value\'\n\t\t'
-    print '\t--datadir directory\n\t\tSpecifies the  location  of  the  HTMLDOC  data  files,  usually  /usr/share/htmldoc  or  C:\Program Files\HTMLDOC '
+    print('Usage:')
+    print("\t%s [options] input_filename [output_filename]" % name)
+    print()
+    print('Options:')
+    print()
+    print('\t--beautifulsoup\n\t\tCorrect the HTML code of the pages before converting them to PDF. The BeautifulSoup package (see http://www.crummy.com/software/BeautifulSoup/) needs to be installed.')
+    print('\t--bodycolor color\n\t\tSpecifies the background color for all pages.')
+    print('\t--bodyfont {courier,helvetica,monospace,sans,serif,times}. Default is times.')
+    print('\t--bodyimage filename.{bmp,gif,jpg,png}')
+    print('\t--book\n\t\tSpecifies that the HTML sources are structured (headings, chapters, etc.).')
+    print('\t--bottom margin{in,cm,mm}\n\t\tSpecifies the bottom margin in points (no suffix or ##pt), inches  (##in),  centimeters  (##cm),  or millimeters (##mm).')
+    print('\t--browserwidth pixels\n\t\tSee http://www.htmldoc.org/newsgroups.php?ghtmldoc.general+v:3465')
+    print('\t--charset {cp-874...1258,iso-8859-1...8859-15,koi8-r}\n\t\tSpecifies the ISO character set to use for the output.')
+    print('\t--color\n\t\tSpecifies that PDF output should be in color.')
+    print('\t--compression[=level]\n\t\t')
+    print('\t--continuous\n\t\tSpecifies  that  the  HTML  sources are unstructured (plain web pages).\n\t\tNo page breaks are inserted between each file or URL in the output.')
+    print('\t--cookies \'name="value with space"; name=value\'\n\t\t')
+    print('\t--datadir directory\n\t\tSpecifies the  location  of  the  HTMLDOC  data  files,  usually  /usr/share/htmldoc  or  C:\Program Files\HTMLDOC ')
 #    print "\t--dontextract \n\t\tIf given, %s will not extract the HTML files from the given CHM file, but will use previously extracted copies from the temporary directory " %name + '(i.e. ' + CHM2PDF_TEMP_ORIG_DIR + ' and ' + CHM2PDF_TEMP_WORK_DIR + '). Usually you will use this option after you have used the \'--extract-only\' option to extract the files in order to correct them manually (in ' + CHM2PDF_TEMP_WORK_DIR + '). After the correction, a call with \'--dontextract\' will not overwrite your changes, but will use the corrected files instead.'
-    print '\t--duplex\n\t\tSpecifies that the output should be formatted for double-sided printing.'
-    print '\t--effectduration {0.1..10.0}\n\t\tSpecifies the duration in seconds of PDF page transition effects.'
-    print '\t--embedfonts\n\t\tSpecifies that fonts should be embedded in PDF output.'
-    print '\t--encryption\n\t\tEnables encryption of PDF files.'
-    print '\t--extract-only\n\t\tExtract the HTML files from the CHM file and stop.\n\t\tThe extracted files will be found in CHM2PDF_WORK_DIR/input_filename_without_extension.'
-    print '\t--firstpage {p1,toc,c1}\n\t\t'
-    print '\t--fontsize {4.0..24.0}\n\t\tSpecifies the default font size for body text.'
-    print '\t--fontspacing {1.0..3.0}\n\t\tSpecifies  the  default  line  spacing  for body text.\n\t\tThe line spacing is a multiplier for the font size, so a value of 1.2 \n\t\twill provide an additional 20% of space between the lines.'
-    print '\t--footer fff\n\t\t'
-    print '\t{--format, -t} {pdf11,pdf12,pdf13,pdf14}\n\t\tSpecifies the output format: pdf11\n\t\tpdf11 (PDF 1.1/Acrobat 2.0), pdf12 (PDF 1.2/Acrobat 3.0), \n\t\tpdf or pdf13 (PDF  1.3/Acrobat  4.0),  or  pdf14 (PDF 1.4/Acrobat 5.0)'
-    print '\t--gray\n\t\t'
-    print '\t--header fff\n\t\t'
-    print '\t--header1 fff\n\t\t'
-    print '\t--headfootfont {courier{-bold,-oblique,-boldoblique}, \n\t\thelvetica{-bold,-oblique,-boldoblique}, \n\t\tmonospace{-bold,-oblique,-boldoblique}, \n\t\tsans{-bold,-oblique,-boldoblique}, \n\t\tserif{-bold,-italic,-bolditalic}, \n\t\ttimes{-roman,-bold,-italic,-bolditalic}} \n\t\t\tSets the font to use on headers and footers.'
-    print '\t--headfootsize {6.0..24.0}\n\t\tSets the size of the font to use on headers and footers.'
-    print '\t--headingfont {courier,helvetica,monospace,sans,serif,times}\n\t\tSets the typeface to use for headings.'
-    print '\t--help\n\t\tDisplays a summary of command-line options.'
-    print '\t--hfimage0 filename.{bmp,gif,jpg,png}\n\t\t '
-    print '\t--hfimage1 filename.{bmp,gif,jpg,png}\n\t\t '
-    print '\t--hfimage2 filename.{bmp,gif,jpg,png}\n\t\t '
-    print '\t--hfimage3 filename.{bmp,gif,jpg,png}\n\t\t '
-    print '\t--hfimage4 filename.{bmp,gif,jpg,png}\n\t\t '
-    print '\t--hfimage5 filename.{bmp,gif,jpg,png}\n\t\t '
-    print '\t--hfimage6 filename.{bmp,gif,jpg,png}\n\t\t '
-    print '\t--hfimage7 filename.{bmp,gif,jpg,png}\n\t\t '
-    print '\t--hfimage8 filename.{bmp,gif,jpg,png}\n\t\t '
-    print '\t--hfimage9 filename.{bmp,gif,jpg,png}\n\t\t '
-    print '\t--jpeg quality\n\t\tSets the JPEG compression level to use for large images. A value of 0 disables JPEG compression.'
-    print '\t--landscape\n\t\t'
-    print '\t--left margin{in,cm,mm}\n\t\tSpecifies the left margin in points (no suffix or ##pt), inches (##in), centimeters (##cm), or  millimeters (##mm).'
-    print '\t--linkcolor color\n\t\tSets the color of links. You can use well-known color names like blue, or the usual #RRGGBB notation.'
-    print '\t--links\n\t\tEnables generation of links in PDF files (default).'
-    print '\t--linkstyle {plain,underline}\n\t\tSets the style of links.'
-    print '\t--logoimage filename.{bmp,gif,jpg,png}\n\t\tSpecifies an image to be used as a logo in the header or footer in a PDF document.'
-    print '\t--logoimage filename.{bmp,gif,jpg,png}\n\t\tNote that you need to use the --header and/or --footer options with the l parameter.'
-    print '\t--no-compression\n\t\tDisables compression of PDF file.'
-    print '\t--no-duplex\n\t\tDisables double-sided printing.'
-    print '\t--no-embedfonts\n\t\tSpecifies that fonts should not be embedded in PDF and PostScript output.'
-    print '\t--no-encryption\n\t\tDisables document encryption.'
-    print '\t--no-links\n\t\tDisables generation of links in a PDF document. '
-    print '\t--no-localfiles\n\t\t'
-    print '\t--no-numbered\n\t\tDisables automatic heading numbering.'
-    print '\t--no-overflow\n\t\t'
-    print '\t--no-strict\n\t\tDisables strict HTML input checking.'
-    print '\t--no-title\n\t\tDisables generation of a title page.'
-    print '\t--no-toc\n\t\tDisables generation of a table of contents.'
-    print '\t--numbered\n\t\tNumbers all headings in a document.'
-    print '\t--nup {1,2,4,6,9,16}\n\t\tSets  the  number of pages that are placed on each output page.  Valid values are 1, 2, 4, 6, 9, and 16.'
-    print '\t{--outfile, -f} filename{.pdf}\n\t\tSpecifies the name of the output file. If no ending is given, ".pdf" is used.'
-    print '\t--overflow\n\t\t'
-    print '\t--owner-password password\n\t\tSets the owner password for encrypted PDF files.'
-    print '\t--pageduration {1.0..60.0}\n\t\tSets the view duration of a page in a PDF document.'
-    print '\t--pageeffect {none,bi,bo,d,gd,gdr,gr,hb,hsi,hso,vb,vsi,vso,wd,wl,wr,wu}\n\t\tSpecifies the page transition effect for all pages; this attribute is ignored by all Adobe PDF viewers.. '
-    print '\t--pagelayout {single,one,twoleft,tworight}\n\t\tSpecifies the initial layout of pages for a PDF file.'
-    print '\t--pagemode {document,outline,fullscreen}\n\t\tSpecifies the initial viewing mode for a PDF file.'
-    print '\t--path "dir1;dir2;dir3;...;dirN"\n\t\tSpecifies a search path for files in a document.'
-    print '\t--permissions {all,annotate,copy,modify,print,no-annotate,no-copy,no-modify,no-print,none}\n\t\tSpecifies document permissions for encrypted PDF files. Separate multiple permissions with commas. '
-    print '\t--portrait\n\t\t'
-    print '\t--prefontsize {4.0..24.0, small, normal, big, huge, +1, +2, -1, -2,...whatever}\n\t\tSpecifies the font size for text inside <pre> tags. Whatever you pass here will be used as font size inside preformatted pieces of text (usually code snippets, console output, program messages...). Effective only together with the \'--beautifulsoup\' option.'
-    print '\t--quiet\n\t\tSuppresses all messages, even error messages.'
-    print '\t--right margin{in,cm,mm}\n\t\tSpecifies the right margin in points (no suffix or ##pt), inches (##in), centimeters (##cm), or millimeters (##mm).'
-    print '\t--size {letter,a4,WxH{in,cm,mm},etc}\n\t\tSpecifies the page size using a standard name or in points (no suffix or ##x##pt), inches (##x##in),\n\t\tcentimeters (##x##cm), or millimeters (##x##mm). The standard sizes that  are  currently  recognized\n\t\tare "letter" (8.5x11in), "legal" (8.5x14in), "a4" (210x297mm), and "universal" (8.27x11in).'
-    print '\t--strict\n\t\tEnables strict HTML input checking.'
-    print '\t--textcolor color\n\t\tSpecifies the default color of all text.'
-    print '\t--textfont {courier,helvetica,monospace,sans,serif,times}\n\t\t'
-    print '\t--title\n\t\tEnables the generation of a title page.'
-    print '\t--titlefile filename.{htm,html,shtml}\n\t\tSpecifies  the  file to use for the title page. If the file is an image then the title page\n\t\tis automatically generated using the document meta data and image title.'
-    print '\t--titleimage filename.{bmp,gif,jpg,png}\n\t\tSpecifies  the  image to use for the title page. The title page is automatically \n\t\tgenerated using the document meta data and title image.'
-    print '\t--tocfooter fff\n\t\tSets the page footer to use on table-of-contents pages. See below for the format of fff.'
-    print '\t--tocheader fff\n\t\tSets the page header to use on table-of-contents pages. See below for the format of fff.'
-    print '\t--toclevels levels\n\t\tSets the number of levels in the table-of-contents.'
-    print '\t--toctitle string\n\t\tSets the title for the table-of-contents.'
-    print '\t--top margin{in,cm,mm}\n\t\tSpecifies the top margin in points (no suffix or ##pt), inches (##in), centimeters (##cm),  or  millimeters (##mm).'
-    print '\t--user-password password\n\t\tSpecifies the user password for encryption of PDF files.'
-    print '\t--verbose\n\t\tDisplays various messages indicating the progress of the conversion process. The verbosity depends on --verbositylevel. If --verbose is not set, almost no messages will be printed. The default is \'not set\', so if you want the minimum amount of messages, just don\' use this option.'
-    print '\t--verbositylevel\n\t\tSpecifies the verbosity level of the messages. Can be either \'low\' or \'high\'. Default is low. The --verbose option must be set, otherwise this option will have no effect.'
-    print '\t--version\n\t\tDisplays the current version number.'
-    print '\t--webpage\n\t\tSpecifies  that  the  HTML  sources  are  unstructured  (plain web pages).\n\t\tA page break is inserted between each file or URL in the output.'
-    print
-    print '\tfff\n\t\tHeading format string; each \'f\' can be one of:'
-    print
-    print '\t\t\t. = blank'
-    print '\t\t\t/ = n/N arabic page numbers (1/3, 2/3, 3/3)'
-    print '\t\t\t: = c/C arabic chapter page numbers (1/2, 2/2, 1/4, 2/4, ...)'
-    print '\t\t\t1 = arabic numbers (1, 2, 3, ...)'
-    print '\t\t\ta = lowercase letters'
-    print '\t\t\tA = uppercase letters'
-    print '\t\t\tc = current chapter heading'
-    print '\t\t\tC = current chapter page number (arabic)'
-    print '\t\t\td = current date'
-    print '\t\t\tD = current date and time'
-    print '\t\t\th = current heading'
-    print '\t\t\ti = lowercase roman numerals'
-    print '\t\t\tI = uppercase roman numerals'
-    print '\t\t\tl = logo image'
-    print '\t\t\tt = title text'
-    print '\t\t\tT = current time'
-    print
-    print '### See also: http://www.karakas-online.de/forum/viewtopic.php?t=10275'
+    print('\t--duplex\n\t\tSpecifies that the output should be formatted for double-sided printing.')
+    print('\t--effectduration {0.1..10.0}\n\t\tSpecifies the duration in seconds of PDF page transition effects.')
+    print('\t--embedfonts\n\t\tSpecifies that fonts should be embedded in PDF output.')
+    print('\t--encryption\n\t\tEnables encryption of PDF files.')
+    print('\t--extract-only\n\t\tExtract the HTML files from the CHM file and stop.\n\t\tThe extracted files will be found in CHM2PDF_WORK_DIR/input_filename_without_extension.')
+    print('\t--firstpage {p1,toc,c1}\n\t\t')
+    print('\t--fontsize {4.0..24.0}\n\t\tSpecifies the default font size for body text.')
+    print('\t--fontspacing {1.0..3.0}\n\t\tSpecifies  the  default  line  spacing  for body text.\n\t\tThe line spacing is a multiplier for the font size, so a value of 1.2 \n\t\twill provide an additional 20% of space between the lines.')
+    print('\t--footer fff\n\t\t')
+    print('\t{--format, -t} {pdf11,pdf12,pdf13,pdf14}\n\t\tSpecifies the output format: pdf11\n\t\tpdf11 (PDF 1.1/Acrobat 2.0), pdf12 (PDF 1.2/Acrobat 3.0), \n\t\tpdf or pdf13 (PDF  1.3/Acrobat  4.0),  or  pdf14 (PDF 1.4/Acrobat 5.0)')
+    print('\t--gray\n\t\t')
+    print('\t--header fff\n\t\t')
+    print('\t--header1 fff\n\t\t')
+    print('\t--headfootfont {courier{-bold,-oblique,-boldoblique}, \n\t\thelvetica{-bold,-oblique,-boldoblique}, \n\t\tmonospace{-bold,-oblique,-boldoblique}, \n\t\tsans{-bold,-oblique,-boldoblique}, \n\t\tserif{-bold,-italic,-bolditalic}, \n\t\ttimes{-roman,-bold,-italic,-bolditalic}} \n\t\t\tSets the font to use on headers and footers.')
+    print('\t--headfootsize {6.0..24.0}\n\t\tSets the size of the font to use on headers and footers.')
+    print('\t--headingfont {courier,helvetica,monospace,sans,serif,times}\n\t\tSets the typeface to use for headings.')
+    print('\t--help\n\t\tDisplays a summary of command-line options.')
+    print('\t--hfimage0 filename.{bmp,gif,jpg,png}\n\t\t ')
+    print('\t--hfimage1 filename.{bmp,gif,jpg,png}\n\t\t ')
+    print('\t--hfimage2 filename.{bmp,gif,jpg,png}\n\t\t ')
+    print('\t--hfimage3 filename.{bmp,gif,jpg,png}\n\t\t ')
+    print('\t--hfimage4 filename.{bmp,gif,jpg,png}\n\t\t ')
+    print('\t--hfimage5 filename.{bmp,gif,jpg,png}\n\t\t ')
+    print('\t--hfimage6 filename.{bmp,gif,jpg,png}\n\t\t ')
+    print('\t--hfimage7 filename.{bmp,gif,jpg,png}\n\t\t ')
+    print('\t--hfimage8 filename.{bmp,gif,jpg,png}\n\t\t ')
+    print('\t--hfimage9 filename.{bmp,gif,jpg,png}\n\t\t ')
+    print('\t--jpeg quality\n\t\tSets the JPEG compression level to use for large images. A value of 0 disables JPEG compression.')
+    print('\t--landscape\n\t\t')
+    print('\t--left margin{in,cm,mm}\n\t\tSpecifies the left margin in points (no suffix or ##pt), inches (##in), centimeters (##cm), or  millimeters (##mm).')
+    print('\t--linkcolor color\n\t\tSets the color of links. You can use well-known color names like blue, or the usual #RRGGBB notation.')
+    print('\t--links\n\t\tEnables generation of links in PDF files (default).')
+    print('\t--linkstyle {plain,underline}\n\t\tSets the style of links.')
+    print('\t--logoimage filename.{bmp,gif,jpg,png}\n\t\tSpecifies an image to be used as a logo in the header or footer in a PDF document.')
+    print('\t--logoimage filename.{bmp,gif,jpg,png}\n\t\tNote that you need to use the --header and/or --footer options with the l parameter.')
+    print('\t--no-compression\n\t\tDisables compression of PDF file.')
+    print('\t--no-duplex\n\t\tDisables double-sided printing.')
+    print('\t--no-embedfonts\n\t\tSpecifies that fonts should not be embedded in PDF and PostScript output.')
+    print('\t--no-encryption\n\t\tDisables document encryption.')
+    print('\t--no-links\n\t\tDisables generation of links in a PDF document. ')
+    print('\t--no-localfiles\n\t\t')
+    print('\t--no-numbered\n\t\tDisables automatic heading numbering.')
+    print('\t--no-overflow\n\t\t')
+    print('\t--no-strict\n\t\tDisables strict HTML input checking.')
+    print('\t--no-title\n\t\tDisables generation of a title page.')
+    print('\t--no-toc\n\t\tDisables generation of a table of contents.')
+    print('\t--numbered\n\t\tNumbers all headings in a document.')
+    print('\t--nup {1,2,4,6,9,16}\n\t\tSets  the  number of pages that are placed on each output page.  Valid values are 1, 2, 4, 6, 9, and 16.')
+    print('\t{--outfile, -f} filename{.pdf}\n\t\tSpecifies the name of the output file. If no ending is given, ".pdf" is used.')
+    print('\t--overflow\n\t\t')
+    print('\t--owner-password password\n\t\tSets the owner password for encrypted PDF files.')
+    print('\t--pageduration {1.0..60.0}\n\t\tSets the view duration of a page in a PDF document.')
+    print('\t--pageeffect {none,bi,bo,d,gd,gdr,gr,hb,hsi,hso,vb,vsi,vso,wd,wl,wr,wu}\n\t\tSpecifies the page transition effect for all pages; this attribute is ignored by all Adobe PDF viewers.. ')
+    print('\t--pagelayout {single,one,twoleft,tworight}\n\t\tSpecifies the initial layout of pages for a PDF file.')
+    print('\t--pagemode {document,outline,fullscreen}\n\t\tSpecifies the initial viewing mode for a PDF file.')
+    print('\t--path "dir1;dir2;dir3;...;dirN"\n\t\tSpecifies a search path for files in a document.')
+    print('\t--permissions {all,annotate,copy,modify,print,no-annotate,no-copy,no-modify,no-print,none}\n\t\tSpecifies document permissions for encrypted PDF files. Separate multiple permissions with commas. ')
+    print('\t--portrait\n\t\t')
+    print('\t--prefontsize {4.0..24.0, small, normal, big, huge, +1, +2, -1, -2,...whatever}\n\t\tSpecifies the font size for text inside <pre> tags. Whatever you pass here will be used as font size inside preformatted pieces of text (usually code snippets, console output, program messages...). Effective only together with the \'--beautifulsoup\' option.')
+    print('\t--quiet\n\t\tSuppresses all messages, even error messages.')
+    print('\t--right margin{in,cm,mm}\n\t\tSpecifies the right margin in points (no suffix or ##pt), inches (##in), centimeters (##cm), or millimeters (##mm).')
+    print('\t--size {letter,a4,WxH{in,cm,mm},etc}\n\t\tSpecifies the page size using a standard name or in points (no suffix or ##x##pt), inches (##x##in),\n\t\tcentimeters (##x##cm), or millimeters (##x##mm). The standard sizes that  are  currently  recognized\n\t\tare "letter" (8.5x11in), "legal" (8.5x14in), "a4" (210x297mm), and "universal" (8.27x11in).')
+    print('\t--strict\n\t\tEnables strict HTML input checking.')
+    print('\t--textcolor color\n\t\tSpecifies the default color of all text.')
+    print('\t--textfont {courier,helvetica,monospace,sans,serif,times}\n\t\t')
+    print('\t--title\n\t\tEnables the generation of a title page.')
+    print('\t--titlefile filename.{htm,html,shtml}\n\t\tSpecifies  the  file to use for the title page. If the file is an image then the title page\n\t\tis automatically generated using the document meta data and image title.')
+    print('\t--titleimage filename.{bmp,gif,jpg,png}\n\t\tSpecifies  the  image to use for the title page. The title page is automatically \n\t\tgenerated using the document meta data and title image.')
+    print('\t--tocfooter fff\n\t\tSets the page footer to use on table-of-contents pages. See below for the format of fff.')
+    print('\t--tocheader fff\n\t\tSets the page header to use on table-of-contents pages. See below for the format of fff.')
+    print('\t--toclevels levels\n\t\tSets the number of levels in the table-of-contents.')
+    print('\t--toctitle string\n\t\tSets the title for the table-of-contents.')
+    print('\t--top margin{in,cm,mm}\n\t\tSpecifies the top margin in points (no suffix or ##pt), inches (##in), centimeters (##cm),  or  millimeters (##mm).')
+    print('\t--user-password password\n\t\tSpecifies the user password for encryption of PDF files.')
+    print('\t--verbose\n\t\tDisplays various messages indicating the progress of the conversion process. The verbosity depends on --verbositylevel. If --verbose is not set, almost no messages will be printed. The default is \'not set\', so if you want the minimum amount of messages, just don\' use this option.')
+    print('\t--verbositylevel\n\t\tSpecifies the verbosity level of the messages. Can be either \'low\' or \'high\'. Default is low. The --verbose option must be set, otherwise this option will have no effect.')
+    print('\t--version\n\t\tDisplays the current version number.')
+    print('\t--webpage\n\t\tSpecifies  that  the  HTML  sources  are  unstructured  (plain web pages).\n\t\tA page break is inserted between each file or URL in the output.')
+    print()
+    print('\tfff\n\t\tHeading format string; each \'f\' can be one of:')
+    print()
+    print('\t\t\t. = blank')
+    print('\t\t\t/ = n/N arabic page numbers (1/3, 2/3, 3/3)')
+    print('\t\t\t: = c/C arabic chapter page numbers (1/2, 2/2, 1/4, 2/4, ...)')
+    print('\t\t\t1 = arabic numbers (1, 2, 3, ...)')
+    print('\t\t\ta = lowercase letters')
+    print('\t\t\tA = uppercase letters')
+    print('\t\t\tc = current chapter heading')
+    print('\t\t\tC = current chapter page number (arabic)')
+    print('\t\t\td = current date')
+    print('\t\t\tD = current date and time')
+    print('\t\t\th = current heading')
+    print('\t\t\ti = lowercase roman numerals')
+    print('\t\t\tI = uppercase roman numerals')
+    print('\t\t\tl = logo image')
+    print('\t\t\tt = title text')
+    print('\t\t\tT = current time')
+    print()
+    print('### See also: http://www.karakas-online.de/forum/viewtopic.php?t=10275')
 
 def split(path):
     if path[-1] == os.sep :
@@ -1015,9 +1017,9 @@
         elif o in ('-v', '--verbose'): options['verbose'] = '--verbose'
         elif o == '--verbositylevel': options['verbositylevel'] = a
         elif o == '--version': 
-            print sys.argv[0] + ' version ' + version
-            print 'This is free software; see the source for copying conditions.  There is NO'
-            print 'warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.'
+            print(sys.argv[0] + ' version ' + version)
+            print('This is free software; see the source for copying conditions.  There is NO')
+            print('warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.')
             return
         elif o == '--webpage': options['webpage'] = '--webpage'
 
@@ -1026,10 +1028,10 @@
     # Only one of '--extract-only' and '--dontextract' may be given!
     if options['dontextract'] == '--dontextract' and options['extract-only'] == '--extract-only':
         usage(sys.argv[0])
-        print
-        print '### Either \'--dontextract\' or \'extract-only\' may be given!'
-        print '### Only one of the two options can be present, not both!'
-        print '### See above or try \'' + sys.argv[0] + ' --help | less\' to view the help contents in less.'
+        print()
+        print('### Either \'--dontextract\' or \'extract-only\' may be given!')
+        print('### Only one of the two options can be present, not both!')
+        print('### See above or try \'' + sys.argv[0] + ' --help | less\' to view the help contents in less.')
         return
     #
     # One of '--book' or '--webpage' MUST be given!
@@ -1038,10 +1040,10 @@
                                           (options['book'] == '--book' and options['continuous'] == '--continuous') or
                                           (options['webpage'] == '--webpage' and options['continuous'] == '--continuous')):
         usage(sys.argv[0])
-        print
-        print '### Either \'--book\' or \'--webpage\' or \'--continuous\' MUST be given!'
-        print '### Only one of the three options can be present, not two, or even all three of them!'
-        print '### See above or try \'' + sys.argv[0] + ' --help | less\' to view the help contents in less.'
+        print()
+        print('### Either \'--book\' or \'--webpage\' or \'--continuous\' MUST be given!')
+        print('### Only one of the three options can be present, not two, or even all three of them!')
+        print('### See above or try \'' + sys.argv[0] + ' --help | less\' to view the help contents in less.')
         return
 
     if len(args)==0:
@@ -1069,11 +1071,11 @@
     CHM2PDF_ORIG_DIR = CHM2PDF_TEMP_ORIG_DIR + os.sep + basename
 
     if options['verbose']=='--verbose' and options['verbositylevel']=='low':
-        print 'CHM2PDF_WORK_DIR = ' + CHM2PDF_WORK_DIR
-        print 'CHM2PDF_ORIG_DIR = ' + CHM2PDF_ORIG_DIR
+        print('CHM2PDF_WORK_DIR = ' + CHM2PDF_WORK_DIR)
+        print('CHM2PDF_ORIG_DIR = ' + CHM2PDF_ORIG_DIR)
 
     if not os.path.exists(filename):
-        print 'CHM file "' + filename + '" not found!'
+        print('CHM file "' + filename + '" not found!')
         return
     
     cfile = chm.CHMFile()
@@ -1081,8 +1083,8 @@
 
     if options['dontextract'] == '--dontextract':
         if options['verbose'] == '--verbose':
-            print '\'--dontextract\' option was given. No files will be extracted from CHM.'
-            print 'Will use the files in ' + CHM2PDF_ORIG_DIR + ' and ' + CHM2PDF_WORK_DIR + '.'
+            print('\'--dontextract\' option was given. No files will be extracted from CHM.')
+            print('Will use the files in ' + CHM2PDF_ORIG_DIR + ' and ' + CHM2PDF_WORK_DIR + '.')
     else:
         if options['verbose'] == '--verbose' and options['verbositylevel'] == 'high':
             os.system('extract_chmLib ' + filename + ' ' + CHM2PDF_ORIG_DIR)
openSUSE Build Service is sponsored by