https://github.com/prexview/prexview-ruby
Transform your data from XML or JSON to high quality, beautiful and readable documents in PDF, HTML, PNG or JPG
https://github.com/prexview/prexview-ruby
converter document-conversion image json json-parser json-to-html json-to-pdf json-to-png pdf transform xml xml-parser xml-to-html xml-to-pdf xml-to-png
Last synced: about 1 month ago
JSON representation
Transform your data from XML or JSON to high quality, beautiful and readable documents in PDF, HTML, PNG or JPG
- Host: GitHub
- URL: https://github.com/prexview/prexview-ruby
- Owner: prexview
- License: mit
- Created: 2017-01-16T22:15:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-07T03:33:08.000Z (about 8 years ago)
- Last Synced: 2025-03-16T18:19:01.020Z (2 months ago)
- Topics: converter, document-conversion, image, json, json-parser, json-to-html, json-to-pdf, json-to-png, pdf, transform, xml, xml-parser, xml-to-html, xml-to-pdf, xml-to-png
- Language: Ruby
- Homepage: https://prexview.com
- Size: 123 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# 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:
```ruby
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](https://prexview.com/downloads/)
If you don't have an account create one and open the API option

There are two ways to use the token, our recomendation and good practice is to use the default environment variable `PREXVIEW_TOKEN` :
```bash
$ export PREXVIEW_TOKEN=
```In your application
```ruby
# xml example
xml = "hello world"
code, response = PrexView.send_xml(xml, {type: 'xml', design: "design-xml"})
``````ruby
# 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
```ruby
# xml example
xml = "hello world"
PrexView.send_xml(xml, {type: 'xml', design: "design-xml", token: "" })
``````ruby
# json example
json = { "hello": "world" }
code, response = PrexView.send_json(json, {type: 'json', design: "design-json", token: "" })
```**Design:** For use design first you add a design in PrexView Studio, go to design section and create one:

For more information please check the [documentation](https://prexview.com/docs/) or look our [examples](/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](http://contributor-covenant.org) code of conduct.
## Credits
This gem is developed and maintained by [Urielable](https://twitter.com/urielable) - [blog](http://blog.urielable.com/)
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).