code: def prep_pdf(qc_dir, config):
      
      html_file = os.path.join(qc_dir, "fastqc", "fastqc_report.html")
      html_fixed = "%s-fixed%s" % os.path.splitext(html_file)
      try:
          topdf = config_utils.get_program("wkhtmltopdf", config)
      except config_utils.CmdNotFound:
          topdf = None
      if topdf and utils.file_exists(html_file):
          out_file = "%s.pdf" % os.path.splitext(html_file)[0]
          if not utils.file_exists(out_file):
              cmd = ("sed 's/div.summary/div.summary-no/' %s | sed 's/div.main/div.main-no/' > %s"
                     % (html_file, html_fixed))
              do.run(cmd, "Fix fastqc CSS to be compatible with wkhtmltopdf")
              cmd = [topdf, html_fixed, out_file]
              do.run(cmd, "Convert QC HTML to PDF")
          return out_file
docs: Create PDF from HTML summary outputs in QC directory.
  
      Requires wkhtmltopdf installed: http://www.msweet.org/projects.php?Z1
      Thanks to: https://www.biostars.org/p/16991/
  
      Works around issues with CSS conversion on CentOS by adjusting CSS.