0.0
No commit activity in last 3 years
No release in over 3 years
Simplified access to the easypdfcloud.com RESTful API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

< 2.0.0, >= 0.9
 Project Readme

EasyPDFCloud

easypdfcloud.com provides a RESTful API for accessing

This branch supports version 1 of api.easypdfcloud.com.

Developer API Reference

This gem assumes you've gone through the OAuth process and have a refresh token.
The easypdfcloud.com access token expires in an hour so this gem requires a refresh token to be configured so it can automatically refresh when needed.

Configuration:

client_id: '...'
client_secret: '...'
workflow_id: '0000000000000001'
refresh_token: '...'
version: 'v1'

Usage:

pdf_cloud_config = YAML.load_file(File.join(Rails.root, "config", "easypdfcloud.yml"))
pdf_cloud = EasyPdfCloud::Client.new(pdf_cloud_config)

# Local File System conversion. Uses configured workflow id.  
out_filepath = pdf_cloud.convert("/path/to/filename.pdf", 'pdf', 'doc')  
# Optionally pass a workflow id  
out_filepath = pdf_cloud.convert("/path/to/filename.pdf", 'pdf', 'doc', workflow_id)  

# Raw Data transform
pdf_data = File.open("somefile.pdf") { |f| f.read }
# This method uses the configured workflow id.
doc_data = pdf_cloud.pdf2word("#{Time.now.to_i}.pdf", pdf_data)
File.open('test.doc', 'wb') {|f| f.write(doc_data)}

Installation

Add this line to your application's Gemfile:

gem 'easy_pdf_cloud'

And then execute:

$ bundle

Or install it yourself as:

$ gem install easy_pdf_cloud

Usage

client = EasyPdfCloud::Client.new(client_id, client_secret, access_token)
puts client.workflows
client.workflow(workflow_id).convert(filename, 'pdf', 'doc')

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request