在 Ruby 中向 PDF 文件插入空白页
Contents
[
Hide
]
Aspose.PDF - 插入空白页
要使用 Aspose.PDF Java for Ruby 在 PDF 文档中插入空白页,只需调用 InsertEmptyPage 模块。
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')
# insert a empty page in a PDF
pdf.getPages().insert(1)
# Save the concatenated output file (the target document)
pdf.save(data_dir+ "output.pdf")
puts "Empty page added successfully!"
下载运行代码
下载\u0412\u00A0插入空页面 (Aspose.PDF)\u0412\u00A0 来自\u0412\u00A0 以下提到的任何社交编码站点: