Browse Source

Fix readme, Controller, JS, add screenshot

Alfred Egger 1 year ago
4 changed files with 19 additions and 18 deletions
  1. +9
  2. +2
  3. +8
  4. BIN

+ 9
- 10 View File

@ -1,31 +1,30 @@
**Plugin for [Nextcloud]( and [ownCloud]( to create hashes of files.**
**App for [Nextcloud]( to print files using the CUPS/LPR printing ecosystem.**
In your Instance, simply navigate to »Apps«, choose the category »Files«, find the Checksum app and enable it.
You need a working CUPS setup with a compatible printer set up as the default printer and the LPR daemon installed on your server.
- Copy the checksum folder in the app directory of owncloud.
- If not already done, rename the app-folder to "checksum" - causes overwise an sql error.
- Enable this app in the admin interface.
In your Instance, simply navigate to »Apps«, choose the category »Tools«, find the Printer app and enable it.
Just open the details view of the file (Sidebar). There should be a new tab called "Checksum". Select a algorithm and it will try to generate a hash. If you want an other algorithm, just click on the reload button.
Just open the details view of the file (Sidebar). There should be a new tab called "Printer". Select a Orientation of your print and it will try to ececute the LPR (Line Printing Daemon) on the CLI to send the job to a printer configured in CUPS. Currently, only the printer set as default can be used for printing.
Possible algorithms are md5, sha1, sha256, sha384, sha512 and crc32.
Possible orientations are "Landscape" and "Portrait". Further options will be added in the future.
- I only tested the app for the current version of owncloud (9.x) and Nextcloud 10 and 11.
- I only tested the app for the current versions of Nextcloud (14 and up).
- I tried to use the current api as much as possible. It should be safe for future versions.
- Currently only files supported by CUPS natively are supported for printing. This includes Images, PDFs, text files and probably others. Not all filetypes are supported by CUPS.
- The app currently misses a lot of features that will be added in future versions of the app. If you want to help out with development, a PR is highly welcome.

+ 2
- 2
js/printer.tabview.js View File

@ -62,7 +62,7 @@
* ajax callback for generating md5 hash
* ajax callback for printing file
check: function(fileInfo, orientation) {
// skip call if fileInfo is null
@ -139,7 +139,7 @@
OCA.Printer = OCA.Primter || {};
OCA.Printer = OCA.Printer || {};
OCA.Printer.PrinterTabView = PrinterTabView;

+ 8
- 6
lib/Controller/PrinterController.php View File

@ -23,12 +23,13 @@ class PrinterController extends Controller {
* callback function to get md5 hash of a file
* @NoAdminRequired
* @param (string) $source - filename
* @param (string) $sourcefile - filename
* @param (string) $orientation - Orientation of printed file
public function printfile($source, $orientation) {
if($orientation == "landscape") {
shell_exec('lpr ' . $source);
public function printfile($sourcefile, $orientation) {
if($orientation === "landscape") {
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
exec('lpr ' . $filefullpath);
return new JSONResponse(
'response' => 'success',
@ -37,8 +38,9 @@ class PrinterController extends Controller {
if($orientation == "portrait"){
shell_exec('lpr -o orientation-requested=4 ' . $source);
if($orientation === "portrait"){
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
exec('lpr -o orientation-requested=4 ' . $filefullpath);
return new JSONResponse(
'response' => 'success',

screenshots/printer.gif View File

Before After
Width: 1400  |  Height: 866  |  Size: 84 KiB