Sha256: 3f41530ca03e6ecc5c475bcb6d8c80ca1ea5af7088ff2ee5f7b135385f1cc039

Contents?: true

Size: 571 Bytes

Versions: 2

Compression:

Stored size: 571 Bytes

Contents

module Asposepdfjava
  module DeletePage
    def initialize()
    	# 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')

        # delete a particular page
        pdf.getPages().delete(2)

        # save the newly generated PDF file
        pdf.save(data_dir + "output.pdf")

        puts "Page deleted successfully!"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asposepdfjava-0.0.2 lib/asposepdfjava/Pages/deletepage.rb
asposepdfjava-0.0.1 lib/asposepdfjava/Pages/deletepage.rb