-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
153 lines (104 loc) · 4.92 KB
/
Copy pathREADME
File metadata and controls
153 lines (104 loc) · 4.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
------------------------------------------------------------------------
-- VuzitJava
-- Vuzit Web Services library for Java
------------------------------------------------------------------------
--------------------------------------------------
-- INTRODUCTION
--------------------------------------------------
This is a library that allows developers to directly access the Vuzit Web
Service API through short commands:
http://vuzit.com/developer/web_service_api
Below is a basic upload example:
com.vuzit.Service.setPublicKey("YOUR_PUBLIC_API_KEY");
com.vuzit.Service.setPrivateKey("YOUR_PRIVATE_API_KEY");
com.vuzit.Document doc = com.vuzit.Document.upload("c:/path/to/document.pdf");
System.out.println("Document id: " + doc.getId());
To get started all you need to do is download the code, sign up for a free
account (https://ssl.vuzit.com/signup) and replace the public and
private keys with the keys from your account.
--------------------------------------------------
-- INITIAL SETUP
--------------------------------------------------
* Take the Vuzit.jar file from the build/jar directory
* Add the JAR file as a reference in your project.
* To check if your install was successful add the code below to your source
code and if it compiles without any errors then you've succeeded.
import com.vuzit;
* If you want to compile the source code then you will need to install Ant
(http://ant.apache.org/) and run the following command in the root
directory (with the build.xml in it):
ant jar
* To build the VuzitCL command-line interface to the Vuzit API run this
command with Ant:
ant bin
--------------------------------------------------
-- GETTING STARTED
--------------------------------------------------
* Download the code - http://github.com/vuzit/vuzitjava/downloads
* Sign up for a free Vuzit account - https://ssl.vuzit.com/signup
* Code Examples - http://wiki.github.com/vuzit/vuzitjava/code_examples
* Vuzit API Reference - http://wiki.github.com/vuzit/vuzitjava/api_reference
* Change log - http://wiki.github.com/vuzit/vuzitjava/change_log
--------------------------------------------------
-- EXAMPLES
--------------------------------------------------
Find Document Example - how to load a document
com.vuzit.Service.setPublicKey("YOUR_PUBLIC_API_KEY");
com.vuzit.Service.setPrivateKey("YOUR_PRIVATE_API_KEY");
com.vuzit.Document doc = com.vuzit.Document.find("DOCUMENT_ID");
System.out.println("Document id: " + doc.getId());
System.out.println("Document title: " + doc.getTitle());
Delete (destroy) Document Example
com.vuzit.Service.setPublicKey("YOUR_PUBLIC_API_KEY");
com.vuzit.Service.setPrivateKey("YOUR_PRIVATE_API_KEY");
com.vuzit.Document.destroy("DOCUMENT_ID");
Upload and View with the JavaScript API Example
<%
// Set the public and private keys
com.vuzit.Service.setPublicKey("YOUR_PUBLIC_API_KEY");
com.vuzit.Service.setPrivateKey("YOUR_PRIVATE_API_KEY");
// Substitute the code below with the Vuzit document ID.
String documentId = "XXXXXXX";
java.util.Date date = new java.util.Date();
// Show document "timestamp" parameter
long timestamp = com.vuzit.Service.epochTime(date);
// Show document "signature" parameter
string signature = com.vuzit.Service.signature("show", documentId, date);
// Creates a URL-encoded signature
string encodedSig = java.net.URLEncoder.encode(signature, "UTF-8");
%>
<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("<%= com.vuzit.Service.getPublicKey() %>");
var options = {signature: '<%= encodedSig %>',
timestamp: '<%= timestamp %>', ssl: true}
var viewer = vuzit.Viewer.fromId("<%= documentId %>", 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>
--------------------------------------------------
-- MORE INFORMATION
--------------------------------------------------
For more information, including installation visit:
http://vuzit.com/developer
--------------------------------------------------
-- LICENSE
--------------------------------------------------
Copyright (c) 2009-2010 Brent Matzelle, Vuzit LLC
Released under the MIT license:
http://www.opensource.org/licenses/mit-license.php
This means you can use it in proprietary products. See LICENSE file.
--------------------------------------------------
-- Feature Requests and Bug Reports
--------------------------------------------------
Email to support AT vuzit DOT com