Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
When accessing an application through the web interface of VirtualUI, a toolbar can be found by moving the mouse (or tapping, for mobile devices) near the bottom of the screen.
The DockMenu Widget presents the following buttons:
Windows list
This button shows the available application windows. Use it to switch between different forms of the application. For example, if a form is not accessible because it ended up below a bigger one.
Error reporting
Press this button to send us an error report. You can edit the subject, descriptions, and details. The 'Details' field is automatically populated with browser information that will help us understand any potential problem. This information does not include any Personally Identifiable Information (PII).
Dock
Use this button to dock or undock the web toolbar to the bottom of the screen. Dock it so that it doesn't disappear when you move away from it. Undock it if you don't want it to show all the time.
Browser Capabilities Info
Displays information about the current browser capabilities.
The mobile version of this toolbar also includes these additional options:
Full Screen
This button toggles the full screen mode in mobile devices where this is supported.
Open Keyboard
Force the mobile keyboard to open.
App.js is a javascript file distributed in the Thinfinity VirtualUI installation. Its purpose is to allow the user to modify some of the application web behaviour.
The file contains the code needed to interact with the VirtualUI objects:
var virtualUI = null; var splash = null;
$(document).ready(function () { splash = new Splash(); virtualUI = new Thinfinity.VirtualUI(); virtualUI.onError = function (errorMsg) { if (errorMsg == null) { errorMsg = ""; } splash.show("Application load failed", errorMsg, false, false); }; virtualUI.onLoading = function () { if (virtualUI.devMode) { splash.show("Waiting for application ...", "", true, false); } else { splash.show("Loading...", "", true, false); } }; virtualUI.onShow = function () { splash.hide(); }; virtualUI.onClose = function (url) { // -- The url argument is used to enable going back to a specific page, when virtualPath is used and url is not null. if ((typeof url != 'undefined') && (url != '') && (url != null)) { // tries to close the window.top if ((virtualUI.devMode != true) || (window.top.opener)) { window.top.close(); } window.top.location.href = url; return; } // if in devMode, reload the page if (virtualUI.devMode) { location.reload(); }
// tries to close the window/tab if ((virtualUI.devMode != true) || (window.opener)) { window.close(); }
// else returns to the calling page
if ((window.top == window) && (document.referrer) && (location.href != document.referrer)) { location.href = document.referrer; } // else shows the splash else { splash.show("Application closed", "", false, false); }
}; // Remove or comment this event to prevent onUnload message prompt. virtualUI.onBeforeUnload = function () { return "You are about to close the application."; } // -- Connect to server...
// -- "ClientSettings" values are used during the start of the connection and then are no longer taken into account, only used as query.
// -- Set values or leave as default. virtualUI.clientSettings = {
// -- Leave as default, server rules (Is not necessary to assign value).
//'CursorVisible': null,
//'MouseMoveGestureStyle': null,
//'MouseMoveGestureAction': null,
// -- Set default values, JS rules.
'UseViewportSize': false,
'DockMenu': {
'Enabled': true,
'Pinned': true,
'Items': {
'WindowList': true,
'ErrorReporting': true,
'BrowserCapabilities': true,
'Keyboard': true,
'Fullscreen': true
}
}
};
// -- Or
////virtualUI.clientSettings.CursorVisible = null;
////virtualUI.clientSettings.MouseMoveGestureStyle = null;
////virtualUI.clientSettings.MouseMoveGestureAction = null;
//// -- Set default values, JS rules.
//virtualUI.clientSettings.DockMenu.Enabled = false;
//virtualUI.clientSettings.DockMenu.Items.WindowList = false;
//virtualUI.clientSettings.DockMenu.Items.ErrorReporting= false;
//virtualUI.clientSettings.DockMenu.Items.BrowserCapabilities = false;
//virtualUI.clientSettings.DockMenu.Items.Keyboard = false;
//virtualUI.clientSettings.DockMenu.Items.Fullscreen = false;
virtualUI.connect(); });
Handling VirtualUI Events
onError
This event is triggered when an error is produced in the communication or inside the VirtualUI obejct.
onLoading
This event is triggered when the page is loaded, before the onShow event.
onShow
This event is triggered when information from the published application starts to arrive.
onClose
This event is triggered when the application is closed.
onBeforeUnload
Returns the message created in the new public event of the VirtualUI class. onBeforeUnload
Remove or comment this event to prevent onUnload message prompt.
connect
This method starts the communication against the VirtualUI server.
This is the one of the most important web components. It's where the remotely accessed applications are shown.
Read more:
Thinfinity VirtualUI includes a printing method that allows you to customize the printing preview dialog.
When printing remotely with a standard dialog, the application has access to the Server's machine. In order to print with the local printers, Thinfinity VirtualUI can now send the document from the server to the browser as a pdf.
When printing, choose 'Thinfinity VirtualUI' as a printer, or create a button in your application that calls this method directly.
You will be presented with the following dialog.
Every time you use this printing method, you will see the following message in the top-right corner of the browser:
This dialog lasts for a couple of seconds before you see the next printing dialog, which can be the VirtualUI preview, or the list of Google Cloud or Local printers.
If you have opted to bypass the VirtualUI preview dialog, you can access it again by clicking on the 'Preparing document...' message, so you can change whether to use Google Cloud Print or Direct Print, or not bypass the dialog the next time.
If you have opted to bypass the VirtualUI preview dialog and you press 'Escape' during the 'Preparing document...' message, you will see either the Google Cloud printers or the local printers.
If you haven't opted to bypass the preview dialog, clicking this button or pressing 'Escape' will take you to the preview dialog.
·
·
·
·
·
·
Bypass this dialog (you can change this option later)
Check this option to bypass this dialog and send the document directly to Direct Print or Google Cloud Print.
Google Cloud Print
Prints this document using your Google Cloud printers. If you are logged into a Google account you will see a list of available printers.
Direct Print
Print this document to the local printers.
Ok
Sends the document to the configured printer. When pressing OK you will either see the Google Printers or the local printers.
Delphi
The Remote Printing SDK allows you to programmatically send commands and documents to the end-user’s printer. Currently, raw printers are supported.
The following table shows the methods of the Remote Printer SDK.
Remote Printer SDK Library
Thinfinity.RemotePrinter.dll
This module presents an COM API to be consumed by a Windows application running under Thinfinity VirtualUI or Thinfinity Remote Desktop.
Thinfinity Local Agent and Local Printer Plugin
Executable and library needed to work as a nexus between the web browser and local or network resources, otherwise inaccessible due to browser’s security restrictions.
Thinfinity Virtual Channels
A proprietary Virtual Channel System used to communicate the Remote Printer SDK with the Local Printer plugin.
The Remote Printer SDK tasks:
Retrieve the printer list.
Prepare the connection for printing.
Send data to the printer
Inform the end of the printing process.
In case of any error must be Cancel the printing or if the user wants.
In case of any error, can get it more details using LastError method
The following table shows the methods of the Remote Printer SDK.
Methods
GetPrinters
GetPrinters(const Delimiter: WideString; out Printers: WideString): WordBool;
Retrieve all printer names detected on the end-user's side. Returns a string delimited by the Delimiter parameter. Returns: True if is successful and False in case of error.
WideString - Character or string used as delimiter of the printer names on Printers param.
WideString - Out parameter filled with the printer names delimited by Delimiter param
LastError
LastError(out ErrorCode: Integer; out ErrorMessage: WideString);
Retrieves the last ErrorCode and ErrorMessage. Can be used when a call to any method returns False. Returns: nothing
Integer - Out last error code. If ErrorCode is 0, there is not error
WideString - Out last error message.
BeginDoc
BeginDoc(PrintType: Integer; const PrinterName: WideString; const DocName: WideString; Encoding: Integer; out DocID: WideString): WordBool;
<b></b>
It makes the connection with the printer and initializes the print job. Creates an unique Document Id to identify a print job in subsequent calls. Returns: True if the communication and actions on the selected printer was sent successful.
Integer - Determines the type of priting. Now support PRINT_TYPE_RAW = 1
WideString - The name that identifies the printer.
WideString - Name of the printer job to be created on the print spooler.
Integer - Identifies the format of the document to print.
PRINT_ENCODE_ANSI = 0
PRINT_ENCODE_UTF8 = 1
WideString - This out parameter is filled with a unique document id to be used in subsequent calls.
Print(const DocID: WideString; const Data: WideString): WordBool;
Sends data to the printer using the document identifier obtained using BeginDoc..
This method can be called as many times as needed to send commands or data until the entire print job is completed. Returns: True if nothing went wrong.
WideString - The document identifier obtained by BeginDoc
WideString - Data to be sent to the Printer.
EndDoc
EndDoc(const DocID: WideString): WordBool
Ends the print job. This completes the print process and sends the print job to the spooler. Returns: True if the work was sent to the printer spooler.
WideString - The document identifier obtained by BeginDoc
Abort
Abort(const DocID: WideString): WordBool
Cancels the printer job.
This method must be called in case of the methods Print or EndDoc return False.
WideString - The document identifier obtained by BeginDoc
PrintFile
PrintFile(PrintType: Integer; const FileName: WideString; const PrinterName: WideString): WordBool;
Sends the file to the print spooler of the remote printer. In case of PrinterName is Empty the default remote printer is used.
Integer - Determines the type of printing.
Now support:
PRINT_TYPE_XPS = 3
PRINT_TYPE_PDF = 4
PRINT_TYPE_DIRECT = 5
WideString - Full FileName of the file to Print.
WideString - The name that identifies the printer.
With the new versions of Thinfinity Remote Desktop (v5.0) and Thinfinity VirtualUI (v3.0), you will be able to take advantage of our new Printer Agent. This will allow you to send your print jobs directly to your local(s) printer(s).
Bear in mind this feature will only be available for the Enterprise editions. Now, let’s get started!
The installation is very simple:
First download the printer agent setup from the link below:
Once you have downloaded the file, run the setup and follow these steps:
In the ‘Welcome’ screen press ‘Next’
Check ‘I accept the terms in the license agreement’ and press ‘Next’
Click ‘Install"
Check the box ‘Launch Thinfinity Virtual Channels Agent’ and click ‘Finish"
Now that we have finished installing the agent, you should be able to see it as a small icon in your system tray. You can right-click it and select ‘Setup Printer’ to configure your printer(s)
The agent should look similar to this
You can see there are two different sections in the agent. There is a combo-box to choose a printer and a checkbox list that will show all your available printers. In the combo-box you will select the default printer you want the “Thinfinity Remote Desktop Printer / Thinfinity VirtualUI Printer” to send the job to. If you leave this combo-box blank, like below, it will send the job to the normal remote printer, which will create a pdf and print to the browser.
The redirected printers box will let you select which other printers you wish to have available on the “remote desktop/application’. Below there's a practical example to understand this better
In the screenshot above you can see a few printers that show ‘(redirected)’ on its name. These printers are the ones you have ‘checked’ in the ‘Redirected Printers’ box.
If you send the print job to “Thinfinity Remote Desktop Server Printer” (or Thinfinity VirtualUI Printer) as shown in the screenshot below, the job will go to your local ‘Microsoft Print to PDF’ (the printer you chose in the combo-box)
You will still be able to choose a different local printer if you wish (the ones allowed in the ‘Redirected Printers’ box).
C#
The Remote Printing SDK allows you to programmatically send commands and documents to the end-user’s printer. Currently, raw printers are supported.
The following table shows the methods of the Remote Printer SDK.
The Remote Printer SDK tasks:
Retrieve the printer list.
Prepare the connection for printing.
Send data to the printer
Inform the end of the printing process.
In case of any error must be Cancel the printing or if the user wants.
In case of any error, can get it more details using LastError method
The following table shows the methods of the Remote Printer SDK.
Methods
String - Character or string used as delimiter of the printer names on Printers param.
String - Out parameter filled with the printer names delimited by Delimiter param
Int - Out last error code. If ErrorCode is 0, there is not error
String - Out last error message.
Int - Determines the type of printing. Now support **PRINT_TYPE___RAW = 1
String - The name that identifies the printer.
String - Name of the printer job to be created on the print spooler.
Int - Identifies the format of the document to print.
PRINT_ENCODE_ANSI = 0
PRINT_ENCODE_UTF8 = 1
String - This out parameter is filled with a unique document id to be used in subsequent calls.
String - The document identifier obtained by BeginDoc
String - Data to be sent to the Printer.
String - The document identifier obtained by BeginDoc
String - The document identifier obtained by BeginDoc
Int - Determines the type of printing.
Now support:
PRINT_TYPE_XPS = 3
PRINT_TYPE_PDF = 4
PRINT_TYPE_DIRECT = 5
String - Full FileName of the file to Print.
String - The name that identifies the printer.
Keep in mind, you can also leave all the printers disabled in the ‘ Redirected Printers’ box and just select the default printer from the combo. This will still send the job to that printer.
Remote Printer SDK Library
Thinfinity.RemotePrinter.dll
This module presents an COM API to be consumed by a Windows application running under Thinfinity VirtualUI or Thinfinity Remote Desktop.
Thinfinity Local Agent and Local Printer Plugin
Executable and library needed to work as a nexus between the web browser and local or network resources, otherwise inaccessible due to browser’s security restrictions.
Thinfinity Virtual Channels
A proprietary Virtual Channel System used to communicate the Remote Printer SDK with the Local Printer plugin.
GetPrinters
bool GetPrinters(string Delimiter, out string Printers);
Retrieve all printer names detected on the end-user's side. Returns a string delimited by the Delimiter parameter. Returns: True if is successful and False in case of error.
LastError
void LastError(out int ErrorCode, out string ErrorMessage);
Retrieves the last ErrorCode and ErrorMessage. Can be used when a call to any method returns False. Returns: nothing
BeginDoc
bool BeginDoc(int PrintType, string PrinterName, string DocName, int Encoding, out string DocID);
It makes the connection with the printer and initializes the print job. Creates an unique Document Id to identify a print job in subsequent calls. Returns: True if the communication and actions on the selected printer was sent successful.
bool Print(string DocID, string Data);
Sends data to the printer using the document identifier obtained using BeginDoc..
This method can be called as many times as needed to send commands or data until the entire print job is completed. Returns: True if nothing went wrong.
EndDoc
bool EndDoc(string DocID);
Ends the print job. This completes the print process and sends the print job to the spooler. Returns: True if the work was sent to the printer spooler.
Abort
bool Abort(string DocID);
Cancels the printer job.
This method must be called in case of the methods Print or EndDoc return False.
PrintFile
bool PrintFile(int PrintType, string FileName, string PrinterName);
<b></b>
Sends the file to the print spooler of the remote printer. In case of PrinterName is Empty the default remote printer is used.