Converting to MHTML Files in Ruby

Aspose.Cells - Converting to MHTML Files

To convert a worksheet to an MHTML file using Aspose.Cells for Java in Ruby, simply invoke the worksheet_to_mhtml() method of the Converter module.

Ruby Code

  

def worksheet_to_mhtml(workbook)  

    save_format = Rjb::import('com.aspose.cells.SaveFormat')  

    # Specify the HTML saving options  

    sv = Rjb::import('com.aspose.cells.HtmlSaveOptions').new(save_format.M_HTML)  

    # Save the document  

    workbook.save(@data_dir + "convert.mht", sv)  

    puts "MHTML saved successfully."  

end  

Download Running Code

Download Converting to MHTML Files (Aspose.Cells) from any of the social coding sites listed below: