ConvertAPI / convertapi-ruby

A Ruby Gem for the ConvertAPI
https://www.convertapi.com
MIT License
11 stars 10 forks source link

Can this thing convert FROM pdf #12

Closed engineer-plus-plus closed 4 years ago

engineer-plus-plus commented 4 years ago

I'm trying to get text out .pdf files. Can this module do that?

laurynas-convertapi commented 4 years ago

Hi @engineer-plus-plus,

yes it can convert PDF to TXT. Example:

ConvertApi.config.api_secret = '<YOUR SECRET HERE>'
ConvertApi.convert('txt', {
    File: ConvertApi::UploadIO.new(File.open('/path/to/my_file.pdf')),
  }, from_format: 'pdf'
).save_files('/path/to/result/dir')

More information: https://www.convertapi.com/pdf-to-txt