guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Jumper <mike.jum...@guac-dev.org>
Subject Re: I am unable to get printing to work in guacamole using the current client for 0.9.9
Date Tue, 18 Apr 2017 17:53:26 GMT
On Tue, Apr 18, 2017 at 7:54 AM, odonya <jodonya@gmail.com> wrote:
> Thanks Mike, I am just connecting to a windows 2016 server. When I set up
> complete guacamole that comes combined server and web client, printing does
> work. But when I run guacamole service and have a html client connect then
> it does not print. We are using this example here
> https://guacamole.incubator.apache.org/doc/gug/writing-you-own-guacamole-app.html

Printing uses the same mechanisms as file transfer. To receive the
printout, you will need to provide an "onfile" handler for your
Guacamole.Client instance:

http://guacamole.incubator.apache.org/doc/guacamole-common-js/Guacamole.Client.html#event:onfile

That function will be given a Guacamole.InputStream (as well as the
mimetype and name of the file), which you can deal with as you see
fit:

http://guacamole.incubator.apache.org/doc/guacamole-common-js/Guacamole.InputStream.html

The easiest way would probably be to wrap that Guacamole.InputStream
in a Guacamole.BlobReader and handle the resulting Blob once the
transfer is complete:

http://guacamole.incubator.apache.org/doc/guacamole-common-js/Guacamole.BlobReader.html

https://developer.mozilla.org/en-US/docs/Web/API/Blob

...but it's really completely up to you. There is intentionally no
default behavior for handling received files, and it's up to the
downstream users of the API to determine how/if file transfer should
be handled, how that gets presented to the user in the UI, what is
ultimately done with the data received, etc.

- Mike

Mime
View raw message