GithubHelp home page GithubHelp logo

Could I download pdf with arx? about arx HOT 2 CLOSED

eonu avatar eonu commented on August 26, 2024
Could I download pdf with arx?

from arx.

Comments (2)

eonu avatar eonu commented on August 26, 2024 1

Hi!

There isn't really an inbuilt feature like this, but you can do it quite easily by:

  1. checking if the paper has a PDF field with .pdf?,
  2. using open-uri to download the paper from its .pdf_url.
require 'open-uri'
require 'arx'

paper = Arx('1809.09415')

if paper.pdf?
  File.open('paper.pdf', 'wb') do |f|
    f.write URI.open(paper.pdf_url).read
  end
end

I'll look into adding this feature directly into the API at some point though, thanks for the suggestion!

from arx.

eonu avatar eonu commented on August 26, 2024

Implemented in #90, you can now use Arx::Paper#save(path) to save the PDF for a paper object.

from arx.

Related Issues (11)

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.