Subject: Bug#738: X2GoClient should make use of an open-source PDF viewer and integrate that, for easier printing support

From: Stefan Baur <[email-masked]>
Date: Sat, 10 Jan 2015 11:01:49 +0100

package: x2goclient
severity: wishlist

The current way of client-side printing is rather error-prone (see
various complaints on the mailing lists lately), also, it requires the
user to be in the fuse group on the server.  Which opens the can of
worms that the user can now also use the built-in file sharing, which
may not be desirable in all circumstances.

Therefore, I would like to suggest the following as new method of
printing:
* x2goclient opens an SSH tunnel:
  -R<somenumber>:127.0.0.1:<someothernumber>
  * <somenumber> should start at a number above 1024, obviously, and a
    mechanism must be in place that determines a free port number, then
    uses that.
  * <someothernumber> should also be a number above 1024, starting at a
    fixed base number and incrementing with each user/session (similar
    to X2Go session numbers).
* on the server, CUPS-X2GO creates a PDF (optionally, compressed using
  gzip, bzip2 or xz - information about the compression method used
  could be conveyed in a PJL header comment field) and streams it to
  socket://127.0.0.1:<someothernumber>

I'm assuming the following two steps are a non-issue for Mac OS X and
Linux, as CUPS is used natively there, and all we have to do there is
connect the two CUPSes via a simple portforwarding.

* On Windows, x2goclient pipes the incoming data either directly as a
  stream, or via a temporary file, to a PDF viewer, which (in the
  simplest case) is set to automatically print to the default printer
  * optionally, we could pop up the print dialog, though this will add
    more complexity
* for ease of use, we should either ship SumatraPDF (a free PDF
  viewer that can be automated via command line options) with
  x2goclient, just as we currently do with pulseaudio and vcxsrv, or
  integrate the relevant parts of SumatraPDF directly into x2goclient,
  if based on the same programming language, and being licensed unter
  terms compatible with ours.

1) This eliminates the need for having users in the FUSE group to
   merely print a document,
2) also, if we can get SumatraPDF to accept the bitstream, it would
   even eliminate the need for a temporary file on the client,
3) lastly, by shipping a PDF viewer/printer, we make it easier for the
   user by providing a sane default (like we do with vcxsrv - users
   still can use a different X server if they choose to, but they don't
   have to download one manually first and worry to get the
   configuration right).

Portable version of SumatraPDF is here:
https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-3.0.zip
Sources are here:
https://github.com/sumatrapdfreader/sumatrapdf

- -Stefan

- -- 
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243