Convert PDF to Excel Workbook in Ruby

Aspose.PDF - Convert PDF to Excel Workbook

To convert PDF document to Excel Workbook using Aspose.PDF Java for Ruby, simply invoke PdfToExcel module.

Ruby Code


# The path to the documents directory.

data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'

# Open the target document

pdf = Rjb::import('com.aspose.pdf.Document').new(data_dir + 'input1.pdf')

# Instantiate ExcelSave Option object

excelsave = Rjb::import('com.aspose.pdf.ExcelSaveOptions').new

# Save the output to XLS format

pdf.save(data_dir + "Converted_Excel.xls", excelsave)

puts "Document has been converted successfully"

Download Running Code

Download Convert PDF to DOC or DOCX (Aspose.PDF) from any of the below mentioned social coding sites: