在 Ruby 中将 Excel 转换为 PDF 文件

Aspose.Cells - 将 Excel 转换为 PDF 文件

要在 Ruby 中使用 Aspose.Cells for Java 将 Excel 转换为 Pdf 文件,只需调用 excel_到_Converter 模块的 pdf() 方法。

红宝石代码

 def excel_to_pdf(workbook)

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

    # Save the document in PDF format

    workbook.save(@data_dir + "MyPdfFile.pdf", save_format.PDF)

    puts "Pdf saved successfully."

end 

下载运行代码

下载**将 Excel 转换为 PDF 文件 (Aspose.Cells)**来自以下任何社交编码网站: