Skip to content

CloudConvertMergePDF is a ruby wrapper for the Cloud Convert combine files to pdf API (https://cloudconvert.com/api/combine)

Notifications You must be signed in to change notification settings

MyExperiments/CloudConvertMergePdf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CloudConvertMergePDF

CloudConvertMergePDF is a ruby wrapper for the Cloud Convert combine files to pdf API. The CloudConvert combine to pdf API merge files of any supported file type to a single PDF file.

Installation

Add this line to your application's Gemfile:

gem 'cloud_convert_merge_pdf'

And then execute:

$ bundle

Basic Usage

Add the following to an initializer file.

CloudConvertMergePdf.configure do |config|
  config.api_key  = "YOUR CLOUD CONVERT API KEY"
end

If you need a file object for the combined pdf:

CloudConvertMergePdf::Merge.new(files).call

If you need the url for the combined pdf:

CloudConvertMergePdf::Merge.new(files, false).call

Basic Example

files = ['http://www.example.com/1.pdf', 'http://www.example.com/2.pdf']
merge_obj = CloudConvertMergePdf::Merge.new(files)
out_file = @client.call # This will return a Tempfile object for the combined pdf
out_file.unlink # Its a good apporach to unlink the tempfile than leaving it for the garbage collector

Contributing

Please feel free to contribute to the repository.

License

The gem is available as open source under the terms of the MIT License.

About

CloudConvertMergePDF is a ruby wrapper for the Cloud Convert combine files to pdf API (https://cloudconvert.com/api/combine)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%