LogoLogo
Download Free TrialLive DemoGet a QuoteContact Us
Thinfinity® VirtualUI 3.0
Thinfinity® VirtualUI 3.0
  • Thinfinity VirtualUI 3.0
  • Architecture
  • Getting Started Section
    • Getting Started
      • Installing Thinfinity VirtualUI
      • Simple UI Remoting
        • Compiling and Testing a WinForms Application
        • Compiling and Testing a Delphi Application
        • Compiling and Testing a C++ Application
        • Registering the Application in Thinfinity VirtualUI Server
        • Accessing the App from the Web
        • Application Execution Behavior
        • List of available demos for download
      • Adapting the Application
        • Customizing the Web Page
          • Preparing the Web Page
          • Customizing Settings
        • Programming VirtualUI
          • Handling VirtualUI Events
          • Using ClientSettings from Javascript
  • Advanced Programming Section
    • Advanced Programming
      • Javascript Remote Objects
        • The Development Lab
        • Life cycle of the jsRO Objects
        • Creating jsRO Objects
        • Updating Properties
        • OnPropertyChange(), OnSet() y OnGet() Events
        • jsRO Remote Calls
          • Remote Methods
          • Custom Events
        • Available demos for Javascript Remote Objects
      • Adding Web Content
        • The HTMLDoc Object
          • Loading Scripts
          • Importing HTML files
          • Accessing local files
          • Creating Web Component instances
        • Web Components
          • Loading Web Component Scripts
          • Importing Web Component HTML files
          • Accessing local resources from the Web Component
  • Advanced Features Section
    • Advanced Features
      • Scaling and Load Balancing
        • Scaling and Load Balancing Configurations
        • Installing components
        • Enabling Multiple RDS Accounts
        • Configuring Load Balancing
        • Sharing your License
          • Installing the License Server Manager
          • Add a Licence
            • Get a new Trial Serial Number
            • Activate a Serial Number Online
            • Activate a Serial Number Offline
          • Sharing your License over multiple Severs
      • Enhanced Browser and DPI Support
        • Model Inheritance
        • Property Reference
        • The Calculation Process
        • Examples
      • One-Time URL
        • How it Works
        • Creating a One-Time URL
      • Passing Command Line Arguments to VirtualUI Apps
        • Setting Command Line Arguments in the Application Profile
        • Sending Command Line Arguments in the VirtualUI URL
        • Building the URL in Javascript
        • Combining Application Profile and URL Command Line Arguments
      • Recording and Playing Sessions
        • Recording a Session
          • The OnRecorderChanged Event
      • Recover Browser Information with BrowserInfo
      • Change Browser Behavior Using ClientSettings
      • End-User Authentication
        • Entering Credentials
        • Processing End-user Credentials
        • Authentication Methods
          • Windows Logon
          • RADIUS
          • OAuth 2.0
            • OAuth2Models.ini
            • CSS for SSO Options
          • External DLL
            • Authentication API
      • Virtualization
        • File System Virtualization
          • Creating File System Redirections
          • The .vdir Files
          • Testing the File System Virtualization
        • Registry Virtualization
          • Creating Registry Redirections
          • The .vreg Files
          • Testing Registry Virtualization
        • Implementing Virtualization in Your Application
      • OEM Licensing
        • How to Create and Revoke Licenses
          • Creating Licenses
          • Revoking Licenses
      • Silent Install Options
  • Web Interface Section
    • Web Interface
      • login.html
      • index.html
      • app.html
        • app.js
        • The DockMenu Widget
        • Printing
          • How to install and use the Printer Agent
          • Printing Preview and Printing
          • Remote Printing SDK for Thinfinity - C#
          • Remote Printing SDK for Thinfinity - Delphi
      • lab.html
  • Configuration Reference Section
    • Configuration Reference
    • Development Server
      • General
      • License Manager
        • Activate a Serial Number Offline
        • Activate a Serial Number Online
        • Get a new Trial Serial Number
        • Proxy Activation
    • Server Manager
      • General
        • Managing the SSL Certificate
          • The Default Embedded Certificate
          • A Self-Signed Certificate
          • A CA Certificate
      • Sessions
      • Applications
        • Application Profile
          • General
          • Credentials
          • Permissions
          • Restrictions
          • Access Hours
          • Authentication Methods
        • Weblink Profile
          • Permissions
      • Authentication
        • Mappings
        • 2FA
          • TOTP
          • Duo Authentication Method Settings
            • How to configure DUO
        • Radius Authentication Method Settings
        • Oauth 2.0 Authentication Method Settings
          • Configure OAuth with Auth0
          • Configure OAuth with Okta
        • External DLL Authentication Method Settings
        • SAML Authentication Method Settings
          • Configure SAML with Okta
          • Configure SAML with Centrify
      • Services
      • License Manager
        • License Activation
          • Proxy Activation
          • Get a new Trial Serial Number
          • Activate a Serial Number Online
          • Activate a Serial Number Offline
    • Gateway Manager
      • Protection
  • Appendix A - Dialogs
    • Appendix A - Dialogs
    • Message Dialogs
      • Message Dlg
      • Input Box
      • Formatted Message
    • Printing Dialogs
      • Print
      • Page Setup
      • Print Preview
    • File Dialogs
      • Open File
      • Save As
  • Appendix B - Tailoring the Interface
    • Customizing the Web Interface
      • Changing the Logo
      • Customizing the Web Files
      • Files Location
  • Symbol Reference Section
    • Thinfinity.VirtualUI Class
Powered by GitBook
On this page
  • Objective
  • Components
  • Basic Scheme
  • API
Export as PDF
  1. Web Interface Section
  2. Web Interface
  3. app.html
  4. Printing

Remote Printing SDK for Thinfinity - C#

C#

PreviousPrinting Preview and PrintingNextRemote Printing SDK for Thinfinity - Delphi

Last updated 3 years ago

Objective

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.

Components

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.

Basic Scheme

The Remote Printer SDK tasks:

  1. Retrieve the printer list.

  2. Prepare the connection for printing.

  3. Send data to the printer

  4. Inform the end of the printing process.

  5. In case of any error must be Cancel the printing or if the user wants.

  6. In case of any error, can get it more details using LastError method

API

The following table shows the methods of the Remote Printer SDK.

Methods

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.

Parameters

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

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

Parameters

Int - Out last error code. If ErrorCode is 0, there is not error

String - Out last error message.

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.

Parameters

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.

Print

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.

Parameters

String - The document identifier obtained by BeginDoc

String - Data to be sent to the Printer.

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.

Parameters

String - The document identifier obtained by BeginDoc

Abort

bool Abort(string DocID);

Cancels the printer job.

This method must be called in case of the methods Print or EndDoc return False.

Parameters

String - The document identifier obtained by BeginDoc

PrintFile

bool PrintFile(int PrintType, string FileName, string PrinterName);

Sends the file to the print spooler of the remote printer. In case of PrinterName is Empty the default remote printer is used.

Parameters

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.