PHP Library for using viewer.filelabel.co in your application.
$viewer = new Fileviewer('YOUR_API_KEY');
$url = $viewer->load('http://viewer.filelabel.co/documents/file.pdf');
header('Location: '.$url);
If you load the document with the basic code above, the URL to your document will be made public. If you'd like to hide that URL, use the following:
$viewer = new Fileviewer('YOUR_API_KEY');
$url = $viewer->load('http://viewer.filelabel.co/documents/file.pdf', true);
This requires at least a "pro" account.
You may want the URL completely hidden and transmitted server side in order to get even better security. Use the following:
$viewer = new Fileviewer(
'YOUR_API_KEY',
'http://viewer.filelabel.co/documents/file.pdf'
);
$viewer->load();
This requires at least a "pro" account.
You may want to limit access to certain features programmatically, depending on your user. The permissions currently available in the app are:
$permissions = array(
'annotate',
'download',
'hideAnnotations',
'print',
'share',
'stickyNotes'
);
Use code like the following. For example, this prevents printing or annotating of the document:
$viewer = new Fileviewer(
'YOUR_API_KEY',
'http://viewer.filelabel.co/documents/file.pdf',
array(
'annotate' => false,
'download' => true,
'hideAnnotations' => true,
'print' => false,
'share' => true,
'stickyNotes' => true
)
);
$viewer->load();
This also requires at least a "pro" account.