This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Code_Examples
Below are a few simple examples using VuzitRuby.
Upload Example
Below is an example that shows how include Vuzit and upload a simple file:
require "vuzitruby"
Vuzit::Service.public_key = 'YOUR_PUBLIC_API_KEY'
Vuzit::Service.private_key = 'YOUR_PRIVATE_API_KEY'
doc = Vuzit::Document.upload("c:/path/to/document.pdf")
puts "Document id: " + doc.id
Find Document Example
Below shows how to load a document.
require "vuzitruby"
Vuzit::Service.public_key = 'YOUR_PUBLIC_API_KEY'
Vuzit::Service.private_key = 'YOUR_PRIVATE_API_KEY'
doc = Vuzit::Document.find("DOCUMENT_ID")
puts "Document id: " + doc.id
puts "Document title: " + doc.title
Delete (destroy) Document
Example for deleting a document.
require "vuzitruby"
Vuzit::Service.public_key = 'YOUR_PUBLIC_API_KEY'
Vuzit::Service.private_key = 'YOUR_PRIVATE_API_KEY'
doc = Vuzit::Document.destroy("DOCUMENT_ID")
Upload and View with HTML
Complete end-to-end example for uploading a document and viewing it with the JavaScript API using a Rails RHTML file:
<%
require "vuzitruby"
require 'cgi'
Vuzit::Service.public_key = 'YOUR_PUBLIC_API_KEY'
Vuzit::Service.private_key = 'YOUR_PRIVATE_API_KEY'
doc = Vuzit::Document.upload("c:/path/to/document.pdf")
timestamp = Time.now
sig = Vuzit::Service.signature("show", doc.id, timestamp)
%>
<html>
<head>
<link href="http://vuzit.com/stylesheets/Vuzit-2.9.css" rel="Stylesheet" type="text/css" />
<script src="http://vuzit.com/javascripts/Vuzit-2.9.js" type="text/javascript"></script>
<script type="text/javascript">
// Called when the page is loaded.
function initialize() {
vuzit.Base.apiKeySet("<%= Vuzit::Service.public_key %>");
var options = {signature: '<%= CGI.escape(sig) %>',
timestamp: '<%= timestamp.to_i %>', ssl: true}
var viewer = vuzit.Viewer.fromId("<%= doc.id %>", options);
viewer.display(document.getElementById("vuzit_viewer"), { zoom: 1 });
}
</script>
</head>
<body onload="initialize()">
<div id="vuzit_viewer" style="width: 650px; height: 500px;"></div>
</body>
</html>






