Vuzit_Document

Class for uploading, loading, and deleting documents using the Vuzit Web Service API: http://vuzit.com/developer/documents_api.

Summary
Vuzit_DocumentClass for uploading, loading, and deleting documents using the Vuzit Web Service API: http://vuzit.com/developer/documents_api.
Functions
getIdReturns the document web ID.
getTitleReturns the document title.
setTitleSets the document tile.
getSubjectReturns the document subject.
getPageCountReturns the document page count.
getPageWidthReturns the document page width.
getPageHeightReturns the document page height.
getFileSizeReturns the document file size.
destroyDeletes a document by the ID.
findByIdFinds a document by the ID.
uploadUploads a file to Vuzit.

Functions

getId

public function getId()

Returns the document web ID.

Returns

string

getTitle

public function getTitle()

Returns the document title.

Returns

string

setTitle

public function setTitle($value)

Sets the document tile.

getSubject

public function getSubject()

Returns the document subject.

Returns

string

getPageCount

public function getPageCount()

Returns the document page count.

Returns

int

getPageWidth

public function getPageWidth()

Returns the document page width.

Returns

int

getPageHeight

public function getPageHeight()

Returns the document page height.

Returns

int

getFileSize

public function getFileSize()

Returns the document file size.

Returns

string

destroy

public static function destroy($id)

Deletes a document by the ID.  Returns true if it succeeded.  It throws a Vuzit_Exception on failure.

Parameters

idDocument ID of the document you would like to destroy.

Returns

’true’ if successful

Example

Vuzit_Service::$PublicKey = 'YOUR_PUBLIC_API_KEY';
Vuzit_Service::$PrivateKey = 'YOUR_PRIVATE_API_KEY';

$result = Vuzit_Document::destroy("DOCUMENT_ID");

findById

public static function findById($id)

Finds a document by the ID.  It throws a Vuzit_Exception on failure.

Parameters

idID of the document you would like to find.

Returns

Vuzit_Document

Example

Vuzit_Service::$PublicKey = 'YOUR_PUBLIC_API_KEY';
Vuzit_Service::$PrivateKey = 'YOUR_PRIVATE_API_KEY';

$doc = Vuzit_Document::findById("DOCUMENT_ID");
echo "Document id: " . $doc->getId();
echo "Document title: " . $doc->getTitle();

upload

public static function upload($file,  
$secure =  true,
$fileType =  null)

Uploads a file to Vuzit.  It throws a Vuzit_Exception on failure.

Parameters

filePath to the file on the file system
secure(Optional) Security type.  A value of ‘true’ indicates private and a value of ‘false’ indicates public.
file_type(Optional) Type of the file: ‘pdf’, ‘doc’, etc.

Returns

Vuzit_Document

Example

Vuzit_Service::$PublicKey = 'YOUR_PUBLIC_API_KEY';
Vuzit_Service::$PrivateKey = 'YOUR_PRIVATE_API_KEY';

$doc = Vuzit_Document::upload("c:/path/to/document.pdf");
echo "Document id: " . $doc->getId();
public function getId()
Returns the document web ID.
public function getTitle()
Returns the document title.
public function setTitle($value)
Sets the document tile.
public function getSubject()
Returns the document subject.
public function getPageCount()
Returns the document page count.
public function getPageWidth()
Returns the document page width.
public function getPageHeight()
Returns the document page height.
public function getFileSize()
Returns the document file size.
public static function destroy($id)
Deletes a document by the ID.
public static function findById($id)
Finds a document by the ID.
public static function upload($file,  
$secure =  true,
$fileType =  null)
Uploads a file to Vuzit.
Vuzit library exception handler class.
Class for uploading, loading, and deleting documents using the Vuzit Web Service API: http://vuzit.com/developer/documents_api.
Close