You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Sean Hulbert <sh...@securitycentric.net.INVALID> on 2025/03/03 22:59:31 UTC

Javascript for Printers

Hello Mike and Nick,

Would you be able to point me to the javascript code in Guacamole that 
controls the Printer PDF?

I like to have me development team create a WAR file to connect 
environment to local printers, much like RDP Drive mapping

-- 

*Thank You*
Sean Hulbert


*Security Centric Inc.*
A Cybersecurity Virtualization Enablement Company
/StormCloud Gov, Protected CUI Environment!/
Industry's most secure CMMC/iTAR virtual desktops!


*/FedRAMP MIL4 in PMO Review/*
System Award Management
*CAGE: 8AUV4*
*SAM ID: UMJLJ8A7BMT3*

AFCEA San Francisco Chapter President
If you have heard of a hacker by name, he/she has failed, fear the 
hacker you haven’t heard of!

CONFIDENTIALITY NOTICE: This communication with its contents may contain 
confidential and/or legally privileged information. It is solely for the 
use of the intended recipient(s). Unauthorized interception, review, use 
or disclosure is prohibited and may violate applicable laws including 
the Electronic Communications Privacy Act. If you are not the intended 
recipient, please contact the sender and destroy all copies of the 
communication. Content within this email communication is not legally 
binding as a contract and no promises are guaranteed unless in a formal 
contract outside this email communication.

igitur qui desiderat pacem, praeparet bellum!!!

Epitoma Rei Militaris

Re: Javascript for Printers

Posted by Nick Couchman <vn...@apache.org>.
On Mon, Mar 3, 2025 at 6:00 PM Sean Hulbert
<sh...@securitycentric.net.invalid> wrote:

> Hello Mike and Nick,
>
> Would you be able to point me to the javascript code in Guacamole that
> controls the Printer PDF?
>
I don't think there is any JavaScript code for this - I believe it's all
done in C, by guacd, and guacd sends the PDF to the client, which then
triggers a download.

See:
https://github.com/apache/guacamole-server/blob/main/src/protocols/rdp/channels/rdpdr/rdpdr-printer.c
https://github.com/apache/guacamole-server/blob/main/src/protocols/rdp/channels/rdpdr/rdpdr-printer.h

The code that handles the download of the PDF file from the printer is the
same code that handles downloads of files using drive redirection:

https://github.com/apache/guacamole-client/blob/main/guacamole/src/main/frontend/src/app/client/directives/guacFileTransfer.js
https://github.com/apache/guacamole-client/blob/main/guacamole/src/main/frontend/src/app/client/types/ManagedFileTransferState.js
https://github.com/apache/guacamole-client/blob/main/guacamole/src/main/frontend/src/app/client/types/ManagedFilesystem.js

> I like to have me development team create a WAR file to connect
> environment to local printers, much like RDP Drive mapping
>
While it may be possible to create a mapping to a printer on the server
running guacd, similar to how the drive redirection works (which wouldn't
be a WAR file, it would be C code), the last time I checked it is not
possible, without some sort of client application/plugin, to handle
client-side printers. There is no native JavaScript mechanism for accessing
and handling printers, and, thus, no way to pass client printers through
Guacamole to the remote system. Other software packages in the past used
things like NPAPI or PPAPI plugins (Flash, Java, etc.) for this type of
functionality, but, with the removal of all of those plugin frameworks from
modern browsers, creating a plugin that handles this seems...difficult.

All that said, I'm happy to be proven wrong about any of that :-).

-Nick

>