Giter VIP home page Giter VIP logo

prexview / prexview-ruby Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 0.0 126 KB

Transform your data from XML or JSON to high quality, beautiful and readable documents in PDF, HTML, PNG or JPG

Home Page: https://prexview.com

License: MIT License

Ruby 97.72% Shell 2.28%
xml pdf converter transform json image xml-parser json-parser document-conversion xml-to-pdf json-to-pdf xml-to-html xml-to-png json-to-html json-to-png

prexview-ruby's Introduction

PrexView

A composer library to use PrexView a fast, scalable and very friendly service for programatic HTML, PDF, PNG or JPG generation using JSON or XML data.

Installation

Add this line to your application's Gemfile:

gem 'PrexView'

And then execute:

$ bundle

Or install it yourself as:

$ gem install PrexView

Quick Start

Get the token key by downloading PrexView Studio, click here for download

If you don't have an account create one and open the API option

API token

There are two ways to use the token, our recomendation and good practice is to use the default environment variable PREXVIEW_TOKEN :

$ export PREXVIEW_TOKEN=<token>

In your application

# xml example
xml = "<xml>hello world</xml>"
code, response = PrexView.send_xml(xml, {type: 'xml', design: "design-xml"})
# json example
json = { "hello": "world" }
code, response = PrexView.send_json(json, {type: 'json', design: "design-json" })

The second way is to pass the token key as a parameter

# xml example
xml = "<xml>hello world</xml>"
PrexView.send_xml(xml, {type: 'xml', design: "design-xml", token: "<token>" })
# json example
json = { "hello": "world" }
code, response = PrexView.send_json(json, {type: 'json', design: "design-json", token: "<token>" })

Design: For use design first you add a design in PrexView Studio, go to design section and create one:

Design

For more information please check the documentation or look our examples

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/prexview/prexview-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Credits

This gem is developed and maintained by Urielable - blog

License

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

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.