Giter Site home page Giter Site logo

convertapi-ruby's People

Contributors

jonas-jasas avatar jonasjasas avatar kostas-jonauskas avatar laurynas-convertapi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

convertapi-ruby's Issues

Gem incompatible with ruby-2.7.0 and upwards

Previously, in one of the project, I had been using this gem with ruby-2.6.5. After upgrading the ruby version to 2.7.2 I started getting some errors. Specifically when I tried to save the converted file using the save method on the ConvertApi::ResultFile module.

when I try to save the converted file like so: converted.file.save('/path/to/file')

I'm getting this error: ArgumentError (extra arguments)

Introduce alternative converter parameter in conversion method

Some formats have several converters, for example, docx to pdf has three of them listed below.
It should be a possibility to set up an alternative converter from the library in the Convert method.

https://v2.convertapi.com/convert/docx/to/pdf
https://v2.convertapi.com/convert/docx/to/pdf/converter/openoffice
https://v2.convertapi.com/convert/docx/to/pdf/converter/printer

This is only an example of a convert method on how it could implement alternative converters.

Default method

ConvertApi.convert('pdf', File: '/path/to/my_file.docx')

with alternative converter

ConvertApi.convert('pdf', File: '/path/to/my_file.docx', converter: 'openoffice')

ConvertApi::ConnectionFailed end of file reached

We are experiencing an issue while trying to convert and merge a pdf.

The error we get is
ConvertApi::ConnectionFailed end of file reached

AFAIK, we haven't touched our side of the code.

Do you have any idea what the source of this problem might be?
I went through the docs and couldn't find anything.

Also our dashboard shows 0 failures and your status page shows that everything is operational.

URI.encode deprecated in Ruby 3

When running with the Ruby 3 getting this error:
...lib/convert_api/client.rb:51:in 'block in upload': undefined method 'encode' for URI:Module (NoMethodError)

StoreFile not honored

The following code:

    result = ConvertApi.convert('txt', { File: document.url, StoreFile: false, RemoveHeadersFooters: true }, from_format: 'pdf')

makes a call to the url with &StoreFile=true.

I think the problem is here:

params = normalize_params(@params).merge(

I think you merge default parameters over top user parameters when you should be doing the merge the other way.

This seems like kind of a security risk having it this way especially since your documentation at: https://www.convertapi.com/pdf-to-txt#snippet=ruby clearly states that the default is false not true.

Documentation improvement

A comment from the user:

It would be really helpful if you provided better documentation on how to access elements of the response objects your API returns. It took me forever to figure out how to actually get the files that were converted, and I did it on my own, not with your documentation. For example, it was not obvious that the response object was returning an array of files that I could access like this:

rtf_file = ConvertApi.convert('rtf', File: 'new.pdf')

rtf_url = rtf_file.files[0].url
open('rtf_file.rtf', 'wb') do |file|
file << open(rtf_url).read
end

Support thread-safe async conversions

We have a use case where some of our conversion requests will be synchronous and some will be asynchronous in the same application.

Async requests are specified by a URI path prefix instead of a request param and I don't see a way to add that prefix to the request builder in a ConvertApi::Task as it is hard-coded to start with /convert

I could modify the base_uri in ConvertApi::Configuration but that would change it for all calls to ConvertApi#convert in the current thread instead of for a single request.

Am I missing something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.