How to get the total number of pages of the existing pdf in rails?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With