在 Ruby 中将 PDF 转换为 DOC 或 DOCX 格式

Aspose.PDF - 将 PDF 转换为 DOC 或 DOCX

要使用 Aspose.PDF Java for Ruby 将 PDF 文档转换为 DOC 或 DOCX 格式,只需调用 PdfToDoc 模块。

Ruby 代码

# 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')

# Save the concatenated output file (the target document)

pdf.save(data_dir + "output.doc")

puts "Document has been converted successfully"

下载运行代码

下载 将 PDF 转换为 DOC 或 DOCX(Aspose.PDF) 来自以下任意社交编码站点: