Module: Asposepdfjava::GetNumberOfPages

Defined in:
lib/asposepdfjava/Pages/getnumberofpages.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/asposepdfjava/Pages/getnumberofpages.rb', line 3

def initialize()
    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
            
    # Create PDF document
    pdf = Rjb::import('com.aspose.pdf.Document').new(data_dir + 'input1.pdf')
    
    page_count = pdf.getPages().size()

    puts "Page Count:" + page_count.to_s
end