code: def to_file(self, output_filename):
          '''Handles pdf and epub format.
          Inpute: output_filename should have the proper extension.
          Output: The name of the file created, or an IOError if failed'''
          temp_file = NamedTemporaryFile(mode="w", suffix=".md", delete=False)
          temp_file.write(self._content)
          temp_file.close()
  
          subprocess_arguments = [PANDOC_PATH, temp_file.name, '-o %s' % output_filename]
          subprocess_arguments.extend(self.arguments)
          cmd = " ".join(subprocess_arguments)
  
          fin = os.popen(cmd)
          msg = fin.read()
          fin.close()
          if msg:
              print("Pandoc message: {}",format(msg))
  
          os.remove(temp_file.name)
  
          if exists(output_filename):
              return output_filename
          else:
              raise IOError("Failed creating file: %s" % output_filenamef to_file(self, output_filename):
          '''Handles pdf and epub format.
          Inpute: output_filename should have the proper extension.
          Output: The name of the file created, or an IOError if failed'''
          temp_file = NamedTemporaryFile(mode="w", suffix=".md", delete=False)
          temp_file.write(self._content)
          temp_file.close()
  
          subprocess_arguments = [PANDOC_PATH, temp_file.name, '-o %s' % output_filename]
          subprocess_arguments.extend(self.arguments)
          cmd = " ".join(subprocess_arguments)
  
          fin = os.popen(cmd)
          msg = fin.read()
          fin.close()
          if msg:
              print("Pandoc message: {}",format(msg))
  
          os.remove(temp_file.name)
  
          if exists(output_filename):
              return output_filename
          else:
              raise IOError("Failed creating file: %s" % output_filename)
docs: Handles pdf and epub format.
          Inpute: output_filename should have the proper extension.
          Output: The name of the file created, or an IOError if failed