How to get the total number of pages of the existing pdf in rails?
            Asked
            
        
        
            Active
            
        
            Viewed 5,023 times
        
    1 Answers
26
            You can use pdf-reader (also available as a ruby gem). Usage is as simple as
reader = PDF::Reader.new("somefile.pdf")
puts reader.page_count
 
    
    
        jupp0r
        
- 4,502
- 1
- 27
- 34
