PrintBrowser is a client for printing content in front-end without extra popups. Using Xaml as the print template language makes it easier to print complex content than using the ESC / TSC command.
Get all printers include virtual printer.
var printers = Internal.getPrinters(); //It is an array containing the name of the printer.
Print Xaml template to printer.
- printerName = string -Should be vaild printer name.
- template = string - Just use the FlowDocument and its child content. All content will wrap.
var printerName =""; //use Internal.getPrinters method get printers' name.
var template = ' \
<FlowDocument PagePadding="0" \
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> \
<Paragraph TextAlignment="Center">Print Test</Paragraph> \
</FlowDocument>';
Internal.print(printerName,template);
// If you want to get the error
try{
Internal.print(printerName,template);
}catch(e)
{
console.log(e);
}