├── README.md ├── WCPAspNetCoreMvcCS ├── Controllers │ ├── DemoPrintCommandsController.cs │ ├── DemoPrintFileController.cs │ ├── DemoPrintFileDOCController.cs │ ├── DemoPrintFilePDFController.cs │ ├── DemoPrintFileWithEncryptionController.cs │ ├── DemoPrintFileWithPwdProtectionController.cs │ ├── DemoPrintFileXLSController.cs │ ├── HomeController.cs │ └── WebClientPrintAPIController.cs ├── Models │ └── ErrorViewModel.cs ├── Program.cs ├── Properties │ ├── PublishProfiles │ │ ├── webclienttools - FTP.pubxml │ │ ├── webclienttools - FTP.pubxml.user │ │ ├── webclienttools - Web Deploy.pubxml │ │ └── webclienttools - Web Deploy.pubxml.user │ └── launchSettings.json ├── Startup.cs ├── Views │ ├── DemoPrintCommands │ │ └── Index.cshtml │ ├── DemoPrintFile │ │ └── Index.cshtml │ ├── DemoPrintFileDOC │ │ └── Index.cshtml │ ├── DemoPrintFilePDF │ │ └── Index.cshtml │ ├── DemoPrintFileWithEncryption │ │ └── Index.cshtml │ ├── DemoPrintFileWithPwdProtection │ │ └── Index.cshtml │ ├── DemoPrintFileXLS │ │ └── Index.cshtml │ ├── Home │ │ ├── Index.cshtml │ │ ├── PrintersInfo.cshtml │ │ └── Samples.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── WCPAspNetCoreMvcCS.csproj ├── appsettings.Development.json ├── appsettings.json ├── files │ ├── GuidingPrinciplesBusinessHR_EN.pdf │ ├── LoremIpsum-PasswordProtected.doc │ ├── LoremIpsum-PasswordProtected.pdf │ ├── LoremIpsum.doc │ ├── LoremIpsum.pdf │ ├── LoremIpsum.txt │ ├── Project-Scheduling-Monitoring-Tool.xls │ ├── Sample-Employee-Handbook.doc │ ├── SamplePngImage.png │ ├── SampleSheet-PasswordProtected.xls │ ├── SampleSheet.xls │ ├── mixed-page-orientation.pdf │ ├── patent2pages.tif │ └── penguins300dpi.jpg └── wwwroot │ ├── css │ ├── site.css │ └── site.min.css │ ├── favicon.ico │ ├── images │ ├── banner1.svg │ ├── banner2.svg │ └── banner3.svg │ ├── js │ └── site.js │ └── lib │ ├── bootstrap │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── npm.js │ ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map ├── WCPMVCCS ├── App_Start │ ├── BundleConfig.cs │ ├── FilterConfig.cs │ └── RouteConfig.cs ├── Content │ ├── Site.css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap-theme.min.css.map │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ └── bootstrap.min.css.map ├── Controllers │ ├── DemoPrintCommandsController.cs │ ├── DemoPrintFileController.cs │ ├── DemoPrintFileDOCController.cs │ ├── DemoPrintFilePDFController.cs │ ├── DemoPrintFileWithEncryptionController.cs │ ├── DemoPrintFileWithPwdProtectionController.cs │ ├── DemoPrintFileXLSController.cs │ ├── HomeController.cs │ └── WebClientPrintAPIController.cs ├── Global.asax ├── Global.asax.cs ├── Properties │ └── AssemblyInfo.cs ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-3.3.1.intellisense.js │ ├── jquery-3.3.1.js │ ├── jquery-3.3.1.min.js │ ├── jquery-3.3.1.min.map │ ├── jquery-3.3.1.slim.js │ ├── jquery-3.3.1.slim.min.js │ ├── jquery-3.3.1.slim.min.map │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ └── modernizr-2.8.3.js ├── Views │ ├── DemoPrintCommands │ │ └── Index.cshtml │ ├── DemoPrintFile │ │ └── Index.cshtml │ ├── DemoPrintFileDOC │ │ └── Index.cshtml │ ├── DemoPrintFilePDF │ │ └── Index.cshtml │ ├── DemoPrintFileWithEncryption │ │ └── Index.cshtml │ ├── DemoPrintFileWithPwdProtection │ │ └── Index.cshtml │ ├── DemoPrintFileXLS │ │ └── Index.cshtml │ ├── Home │ │ ├── Index.cshtml │ │ ├── PrintersInfo.cshtml │ │ └── Samples.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ └── _Layout.cshtml │ ├── Web.config │ └── _ViewStart.cshtml ├── WCPMVCCS.csproj ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── favicon.ico ├── files │ ├── GuidingPrinciplesBusinessHR_EN.pdf │ ├── LoremIpsum-PasswordProtected.doc │ ├── LoremIpsum-PasswordProtected.pdf │ ├── LoremIpsum.doc │ ├── LoremIpsum.pdf │ ├── LoremIpsum.txt │ ├── Sample-Employee-Handbook.doc │ ├── SamplePngImage.png │ ├── SampleSheet-PasswordProtected.xls │ ├── SampleSheet.xls │ ├── mixed-page-orientation.pdf │ ├── mod1.pdf │ ├── patent2pages.tif │ └── penguins300dpi.jpg ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 └── packages.config ├── WCPMVCVB ├── App_Start │ ├── BundleConfig.vb │ ├── FilterConfig.vb │ └── RouteConfig.vb ├── Content │ ├── Site.css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap-theme.min.css.map │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ └── bootstrap.min.css.map ├── Controllers │ ├── DemoPrintCommandsController.vb │ ├── DemoPrintFileController.vb │ ├── DemoPrintFileDOCController.vb │ ├── DemoPrintFilePDFController.vb │ ├── DemoPrintFileWithEncryptionController.vb │ ├── DemoPrintFileWithPwdProtectionController.vb │ ├── DemoPrintFileXLSController.vb │ ├── HomeController.vb │ └── WebClientPrintAPIController.vb ├── Global.asax ├── Global.asax.vb ├── My Project │ ├── Application.Designer.vb │ ├── Application.myapp │ ├── AssemblyInfo.vb │ ├── Resources.Designer.vb │ ├── Resources.resx │ ├── Settings.Designer.vb │ └── Settings.settings ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-3.3.1.intellisense.js │ ├── jquery-3.3.1.js │ ├── jquery-3.3.1.min.js │ ├── jquery-3.3.1.min.map │ ├── jquery-3.3.1.slim.js │ ├── jquery-3.3.1.slim.min.js │ ├── jquery-3.3.1.slim.min.map │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ └── modernizr-2.8.3.js ├── Views │ ├── DemoPrintCommands │ │ └── Index.vbhtml │ ├── DemoPrintFile │ │ └── Index.vbhtml │ ├── DemoPrintFileDOC │ │ └── Index.vbhtml │ ├── DemoPrintFilePDF │ │ └── Index.vbhtml │ ├── DemoPrintFileWithEncryption │ │ └── Index.vbhtml │ ├── DemoPrintFileWithPwdProtection │ │ └── Index.vbhtml │ ├── DemoPrintFileXLS │ │ └── Index.vbhtml │ ├── Home │ │ ├── Index.vbhtml │ │ ├── PrintersInfo.vbhtml │ │ └── Samples.vbhtml │ ├── Shared │ │ ├── Error.vbhtml │ │ └── _Layout.vbhtml │ ├── Web.config │ └── _ViewStart.vbhtml ├── WCPMVCVB.vbproj ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── favicon.ico ├── files │ ├── GuidingPrinciplesBusinessHR_EN.pdf │ ├── LoremIpsum-PasswordProtected.doc │ ├── LoremIpsum-PasswordProtected.pdf │ ├── LoremIpsum.doc │ ├── LoremIpsum.pdf │ ├── LoremIpsum.txt │ ├── Sample-Employee-Handbook.doc │ ├── SamplePngImage.png │ ├── SampleSheet-PasswordProtected.xls │ ├── SampleSheet.xls │ ├── mixed-page-orientation.pdf │ ├── patent2pages.tif │ └── penguins300dpi.jpg ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 └── packages.config ├── WCPWebFormsCS ├── DemoPrintCommands.aspx ├── DemoPrintCommandsHandler.ashx ├── DemoPrintFile.aspx ├── DemoPrintFileDOC.aspx ├── DemoPrintFileDOCHandler.ashx ├── DemoPrintFileHandler.ashx ├── DemoPrintFilePDF.aspx ├── DemoPrintFilePDFHandler.ashx ├── DemoPrintFileWithEncryption.aspx ├── DemoPrintFileWithEncryptionHandler.ashx ├── DemoPrintFileWithPwdProtection.aspx ├── DemoPrintFileWithPwdProtectionHandler.ashx ├── DemoPrintFileXLS.aspx ├── DemoPrintFileXLSHandler.ashx ├── Index.aspx ├── MasterPage.master ├── PrintersInfo.aspx ├── Properties │ ├── AssemblyInfo.cs │ └── PublishProfiles │ │ ├── webclienttools - FTP.pubxml │ │ ├── webclienttools - FTP.pubxml.user │ │ ├── webclienttools - Web Deploy.pubxml │ │ └── webclienttools - Web Deploy.pubxml.user ├── Samples.aspx ├── WCPWebFormsCS.csproj ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── WebClientPrintAPI.ashx ├── files │ ├── GuidingPrinciplesBusinessHR_EN.pdf │ ├── LoremIpsum-PasswordProtected.doc │ ├── LoremIpsum-PasswordProtected.pdf │ ├── LoremIpsum.doc │ ├── LoremIpsum.pdf │ ├── LoremIpsum.txt │ ├── Project-Scheduling-Monitoring-Tool.xls │ ├── Sample-Employee-Handbook.doc │ ├── SamplePngImage.png │ ├── SampleSheet-PasswordProtected.xls │ ├── SampleSheet.xls │ ├── mixed-page-orientation.pdf │ ├── patent2pages.tif │ └── penguins300dpi.jpg └── packages.config └── WCPWebFormsVB ├── DemoPrintCommands.aspx ├── DemoPrintCommandsHandler.ashx ├── DemoPrintFile.aspx ├── DemoPrintFileDOC.aspx ├── DemoPrintFileDOCHandler.ashx ├── DemoPrintFileHandler.ashx ├── DemoPrintFilePDF.aspx ├── DemoPrintFilePDFHandler.ashx ├── DemoPrintFileWithEncryption.aspx ├── DemoPrintFileWithEncryptionHandler.ashx ├── DemoPrintFileWithPwdProtection.aspx ├── DemoPrintFileWithPwdProtectionHandler.ashx ├── DemoPrintFileXLS.aspx ├── DemoPrintFileXLSHandler.ashx ├── Index.aspx ├── MasterPage.master ├── My Project ├── Application.Designer.vb ├── Application.myapp ├── AssemblyInfo.vb ├── MyExtensions │ └── MyWebExtension.vb ├── Resources.Designer.vb ├── Resources.resx ├── Settings.Designer.vb └── Settings.settings ├── PrintersInfo.aspx ├── Samples.aspx ├── WCPWebFormsVB.vbproj ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── WebClientPrintAPI.ashx ├── files ├── GuidingPrinciplesBusinessHR_EN.pdf ├── LoremIpsum-PasswordProtected.doc ├── LoremIpsum-PasswordProtected.pdf ├── LoremIpsum.doc ├── LoremIpsum.pdf ├── LoremIpsum.txt ├── Project-Scheduling-Monitoring-Tool.xls ├── Sample-Employee-Handbook.doc ├── SamplePngImage.png ├── SampleSheet-PasswordProtected.xls ├── SampleSheet.xls ├── mixed-page-orientation.pdf ├── patent2pages.tif └── penguins300dpi.jpg └── packages.config /README.md: -------------------------------------------------------------------------------- 1 | # WebClientPrint 5.0 for **ASP.NET Core, MVC & WebForms** 2 | 3 | ## Overview 4 | [**WebClientPrint 5.0 for ASP.NET Core, MVC & WebForms**](https://neodynamic.com/products/printing/raw-data/aspnet-mvc) is a lightweight and ***plugin-free*** solution for **Client-side Raw Data Printing** scenarios for **Windows**, **Linux**, **Raspberry Pi (Linux ARM)** & **Mac** clients, exclusively designed for **ASP.NET Core, MVC & WebForms** projects. With the **WebClientPrint solution**, you can easily send raw data, text and native commands as well as known file & document formats to printers installed at the client machine without showing or displaying any print dialog box! 5 | 6 | Learn more about [**WebClientPrint 5.0 for ASP.NET MVC & WebForms**](https://neodynamic.com/products/printing/raw-data/aspnet-mvc/) solution! 7 | 8 | ## The WebClientPrint5-Sample Repository 9 | This repo contains WebClientPrint sample projects for ASP.NET Core, MVC & WebForms to getting you started with WebClientPrint 5.0 for ASP.NET Solution 10 | 11 | > IMPORTANT NOTE: You must [**download and install the Neodynamic.SDK.WebClient**](https://neodynamic.com/products/printing/raw-data/aspnet-mvc/download) locally and reference it to these projects! 12 | 13 | ## Know How WebClientPrint 5.0 for ASP.NET MVC & WebForms Works 14 | Refer to the [Online Help Documentation](https://neodynamic.com/Products/Help/WebClientPrint5.0/index.html) 15 | 16 | ## Licensing 17 | 18 | **WebClientPrint is a Commercial** product. Licensing model and prices are available [here](https://neodynamic.com/products/printing/raw-data/aspnet-mvc/buy) 19 | 20 | ## Support 21 | 22 | Tech questions are handled by [Neodynamic Dev Team](https://neodynamic/support) 23 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Controllers/DemoPrintFileDOCController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Neodynamic.SDK.Web; 7 | using Microsoft.AspNetCore.Hosting; 8 | 9 | namespace WCPAspNetCoreCS.Controllers 10 | { 11 | public class DemoPrintFileDOCController : Controller 12 | { 13 | 14 | private readonly IHostingEnvironment _hostEnvironment; 15 | 16 | 17 | public DemoPrintFileDOCController(IHostingEnvironment hostEnvironment) 18 | { 19 | _hostEnvironment = hostEnvironment; 20 | 21 | } 22 | 23 | public IActionResult Index() 24 | { 25 | ViewData["WCPScript"] = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, Url.ActionContext.HttpContext.Request.Scheme), Url.Action("PrintFile", "DemoPrintFileDOC", null, Url.ActionContext.HttpContext.Request.Scheme), Url.ActionContext.HttpContext.Session.Id); 26 | 27 | return View(); 28 | } 29 | 30 | [Microsoft.AspNetCore.Authorization.AllowAnonymous] 31 | public IActionResult PrintFile(string printerName, string pagesRange, string printInReverseOrder, string manualDuplexPrinting) 32 | { 33 | string fileName = Guid.NewGuid().ToString("N"); 34 | string filePath = filePath = "/files/Sample-Employee-Handbook.doc"; 35 | 36 | PrintFileDOC file = new PrintFileDOC(_hostEnvironment.ContentRootPath + filePath, fileName); 37 | file.PagesRange = pagesRange; 38 | file.PrintInReverseOrder = (printInReverseOrder == "true"); 39 | file.DuplexPrinting = (manualDuplexPrinting == "true"); 40 | //file.DuplexPrintingDialogMessage = "Your custom dialog message for duplex printing"; 41 | 42 | 43 | ClientPrintJob cpj = new ClientPrintJob(); 44 | cpj.PrintFile = file; 45 | if (printerName == "null") 46 | cpj.ClientPrinter = new DefaultPrinter(); 47 | else 48 | { 49 | cpj.ClientPrinter = new InstalledPrinter(System.Net.WebUtility.UrlDecode(printerName)); 50 | } 51 | 52 | return File(cpj.GetContent(), "application/octet-stream"); 53 | 54 | } 55 | 56 | } 57 | } -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Controllers/DemoPrintFilePDFController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Neodynamic.SDK.Web; 7 | using Microsoft.AspNetCore.Hosting; 8 | 9 | namespace WCPAspNetCoreCS.Controllers 10 | { 11 | public class DemoPrintFilePDFController : Controller 12 | { 13 | 14 | private readonly IHostingEnvironment _hostEnvironment; 15 | 16 | 17 | public DemoPrintFilePDFController(IHostingEnvironment hostEnvironment) 18 | { 19 | _hostEnvironment = hostEnvironment; 20 | 21 | } 22 | 23 | public IActionResult Index() 24 | { 25 | ViewData["WCPScript"] = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, Url.ActionContext.HttpContext.Request.Scheme), Url.Action("PrintFile", "DemoPrintFilePDF", null, Url.ActionContext.HttpContext.Request.Scheme), Url.ActionContext.HttpContext.Session.Id); 26 | 27 | return View(); 28 | } 29 | 30 | [Microsoft.AspNetCore.Authorization.AllowAnonymous] 31 | public IActionResult PrintFile(string printerName, string trayName, string paperName, string printRotation, string pagesRange, string printAnnotations, string printAsGrayscale, string printInReverseOrder, string manualDuplexPrinting, string driverDuplexPrinting, string pageSizing, string autoRotate, string autoCenter) 32 | { 33 | string fileName = Guid.NewGuid().ToString("N"); 34 | string filePath = filePath = "/files/mixed-page-orientation.pdf"; 35 | 36 | PrintFilePDF file = new PrintFilePDF(_hostEnvironment.ContentRootPath + filePath, fileName); 37 | file.PrintRotation = (PrintRotation)Enum.Parse(typeof(PrintRotation), printRotation); ; 38 | file.PagesRange = pagesRange; 39 | file.PrintAnnotations = (printAnnotations == "true"); 40 | file.PrintAsGrayscale = (printAsGrayscale == "true"); 41 | file.PrintInReverseOrder = (printInReverseOrder == "true"); 42 | 43 | bool bManualDuplexPrinting = (manualDuplexPrinting == "true"); 44 | bool bDriverDuplexPrinting = (driverDuplexPrinting == "true"); 45 | 46 | if (bManualDuplexPrinting && bDriverDuplexPrinting) 47 | { 48 | bManualDuplexPrinting = false; 49 | } 50 | 51 | file.DuplexPrinting = bManualDuplexPrinting; 52 | if (bManualDuplexPrinting) 53 | { 54 | file.DuplexPrinting = bManualDuplexPrinting; 55 | //file.DuplexPrintingDialogMessage = "Your custom dialog message for duplex printing"; 56 | } 57 | file.Sizing = (Sizing)Enum.Parse(typeof(Sizing), pageSizing); 58 | file.AutoCenter = (autoCenter == "true"); 59 | file.AutoRotate = (autoRotate == "true"); 60 | 61 | 62 | 63 | ClientPrintJob cpj = new ClientPrintJob(); 64 | cpj.PrintFile = file; 65 | if (printerName == "null") 66 | cpj.ClientPrinter = new DefaultPrinter(); 67 | else 68 | { 69 | if (trayName == "null") trayName = ""; 70 | if (paperName == "null") paperName = ""; 71 | 72 | cpj.ClientPrinter = new InstalledPrinter(System.Net.WebUtility.UrlDecode(printerName), true, System.Net.WebUtility.UrlDecode(trayName), System.Net.WebUtility.UrlDecode(paperName)); 73 | 74 | if (bDriverDuplexPrinting) 75 | ((InstalledPrinter)cpj.ClientPrinter).Duplex = Duplex.Vertical; 76 | 77 | } 78 | 79 | return File(cpj.GetContent(), "application/octet-stream"); 80 | 81 | } 82 | 83 | } 84 | } -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Controllers/DemoPrintFileXLSController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Neodynamic.SDK.Web; 7 | using Microsoft.AspNetCore.Hosting; 8 | 9 | namespace WCPAspNetCoreCS.Controllers 10 | { 11 | public class DemoPrintFileXLSController : Controller 12 | { 13 | 14 | private readonly IHostingEnvironment _hostEnvironment; 15 | 16 | 17 | public DemoPrintFileXLSController(IHostingEnvironment hostEnvironment) 18 | { 19 | _hostEnvironment = hostEnvironment; 20 | 21 | } 22 | 23 | public IActionResult Index() 24 | { 25 | ViewData["WCPScript"] = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, Url.ActionContext.HttpContext.Request.Scheme), Url.Action("PrintFile", "DemoPrintFileXLS", null, Url.ActionContext.HttpContext.Request.Scheme), Url.ActionContext.HttpContext.Session.Id); 26 | 27 | return View(); 28 | } 29 | 30 | [Microsoft.AspNetCore.Authorization.AllowAnonymous] 31 | public IActionResult PrintFile(string printerName, string pagesFrom, string pagesTo) 32 | { 33 | string fileName = Guid.NewGuid().ToString("N"); 34 | string filePath = filePath = "/files/Project-Scheduling-Monitoring-Tool.xls"; 35 | 36 | PrintFileXLS file = new PrintFileXLS(_hostEnvironment.ContentRootPath + filePath, fileName); 37 | if (string.IsNullOrEmpty(pagesFrom) == false) 38 | file.PagesFrom = int.Parse(pagesFrom); 39 | if (string.IsNullOrEmpty(pagesTo) == false) 40 | file.PagesTo = int.Parse(pagesTo); 41 | 42 | 43 | ClientPrintJob cpj = new ClientPrintJob(); 44 | cpj.PrintFile = file; 45 | if (printerName == "null") 46 | cpj.ClientPrinter = new DefaultPrinter(); 47 | else 48 | { 49 | cpj.ClientPrinter = new InstalledPrinter(System.Net.WebUtility.UrlDecode(printerName)); 50 | } 51 | 52 | return File(cpj.GetContent(), "application/octet-stream"); 53 | 54 | } 55 | 56 | } 57 | } -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using WCPAspNetCoreMvcCS.Models; 8 | 9 | namespace WCPAspNetCoreMvcCS.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | public IActionResult Index() 14 | { 15 | ViewData["WCPPDetectionScript"] = Neodynamic.SDK.Web.WebClientPrint.CreateWcppDetectionScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, Url.ActionContext.HttpContext.Request.Scheme), Url.ActionContext.HttpContext.Session.Id); 16 | 17 | return View(); 18 | } 19 | 20 | 21 | public IActionResult Samples() 22 | { 23 | return View(); 24 | } 25 | 26 | public IActionResult PrintersInfo() 27 | { 28 | ViewBag.WCPScript = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, Url.ActionContext.HttpContext.Request.Scheme), "", Url.ActionContext.HttpContext.Session.Id); 29 | 30 | return View(); 31 | } 32 | 33 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 34 | public IActionResult Error() 35 | { 36 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WCPAspNetCoreMvcCS.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace WCPAspNetCoreMvcCS 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | CreateWebHostBuilder(args).Build().Run(); 18 | } 19 | 20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Properties/PublishProfiles/webclienttools - FTP.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | FTP 9 | AzureWebSite 10 | Release 11 | Any CPU 12 | http://webclienttools.azurewebsites.net 13 | True 14 | False 15 | 9de52a81-08ed-4351-a51d-c85a717bfd7f 16 | ftp://waws-prod-bay-003.ftp.azurewebsites.windows.net 17 | False 18 | True 19 | site/wwwroot 20 | webclienttools\$webclienttools 21 | <_SavePWD>True 22 | 23 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Properties/PublishProfiles/webclienttools - FTP.pubxml.user: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAM+IBltTbYU2hNYvj5AJoqAAAAAACAAAAAAAQZgAAAAEAACAAAAA1/blI3mzbKevKPup9MeyJHOaeNewIUZbFMQMAYIdFLQAAAAAOgAAAAAIAACAAAABi2W+iqBG8FXUuNp5tMi50KMKsBhmjS3AZyxZkfVOjKIAAAADnXEEQOiNpMLW3B+87evTn4DLEqxmZfxkRidqKzUHJbqCeynSFSho4f1NGqYRa2/LuBdxw01WrNOkJ9AZMXRkW84cynvutgH3elT7UjOqq168F0MBUihkwt00bMy6XNE5neENaSoxHSQF6Fo9TQXJQn5EiWbvR2pXslA8LMteMCkAAAADhQAMb/wV6BsFMM14qlhSyJSJ+u7FQCkR/Tn5DZ7NnpuRcvmeKXqnQruO1MM7KrT43tg6F2vi1EnP2BrAcS5on 10 | 11 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Properties/PublishProfiles/webclienttools - Web Deploy.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | MSDeploy 9 | AzureWebSite 10 | Release 11 | Any CPU 12 | http://webclienttools.azurewebsites.net 13 | True 14 | False 15 | 9de52a81-08ed-4351-a51d-c85a717bfd7f 16 | webclienttools.scm.azurewebsites.net:443 17 | webclienttools 18 | 19 | True 20 | WMSVC 21 | True 22 | $webclienttools 23 | <_SavePWD>True 24 | <_DestinationType>AzureWebSite 25 | netcoreapp2.1 26 | false 27 | 28 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Properties/PublishProfiles/webclienttools - Web Deploy.pubxml.user: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAM+IBltTbYU2hNYvj5AJoqAAAAAACAAAAAAAQZgAAAAEAACAAAAAV0BDw6fWeMqKx1z7zcZvJjjHkTpoSkysomni8PPuMkgAAAAAOgAAAAAIAACAAAADB4FGX8y6kXJQrNnnZAANpjvS7Fy4z46NIQEUFnE7uq4AAAADcsF0nIfQrgEqlq9NMY1w4sELEQPPKi/7pK0MiVlXE1KcuCComJNw7rfq964dheAjK76FOBHPjmWdl4D2t55nfLOD5Gwdue0K5VgmTOYgFrMGPLfpmN1LPyIYItYpoAdOyyH+z+pdRj092hYm9ZY8wlZGXN+pG5j4YAQ+ISvsRiUAAAABXl1JxUeq0hqhJvo7e8uXEA/oczrBb8h+I3CdeXd754KcTBvMFL8JW0xQTUlU6YiURuF9zFehWYyTkjAeirEtu 10 | 11 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:62213", 7 | "sslPort": 44397 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "WCPAspNetCoreMvcCS": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.Http; 8 | using Microsoft.AspNetCore.HttpsPolicy; 9 | using Microsoft.AspNetCore.Mvc; 10 | using Microsoft.Extensions.Configuration; 11 | using Microsoft.Extensions.DependencyInjection; 12 | 13 | namespace WCPAspNetCoreMvcCS 14 | { 15 | public class Startup 16 | { 17 | public Startup(IConfiguration configuration) 18 | { 19 | Configuration = configuration; 20 | } 21 | 22 | public IConfiguration Configuration { get; } 23 | 24 | // This method gets called by the runtime. Use this method to add services to the container. 25 | public void ConfigureServices(IServiceCollection services) 26 | { 27 | services.AddDistributedMemoryCache(); 28 | 29 | services.AddSession(options => 30 | { 31 | // Set a short timeout for easy testing. 32 | options.IdleTimeout = TimeSpan.FromSeconds(10); 33 | options.Cookie.HttpOnly = true; 34 | }); 35 | 36 | services.Configure(options => 37 | { 38 | // This lambda determines whether user consent for non-essential cookies is needed for a given request. 39 | options.CheckConsentNeeded = context => true; 40 | options.MinimumSameSitePolicy = SameSiteMode.None; 41 | }); 42 | 43 | 44 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); 45 | } 46 | 47 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 48 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 49 | { 50 | if (env.IsDevelopment()) 51 | { 52 | app.UseDeveloperExceptionPage(); 53 | } 54 | else 55 | { 56 | app.UseExceptionHandler("/Home/Error"); 57 | app.UseHsts(); 58 | } 59 | 60 | app.UseHttpsRedirection(); 61 | app.UseStaticFiles(); 62 | app.UseCookiePolicy(); 63 | 64 | app.UseSession(); 65 | 66 | app.UseMvc(routes => 67 | { 68 | routes.MapRoute( 69 | name: "default", 70 | template: "{controller=Home}/{action=Index}/{id?}"); 71 | }); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Detecting WebClientPrint Processor (WCPP)"; 3 | } 4 | 5 | @section styles{ 6 | 7 | 33 | 34 | } 35 | 36 |
37 |
38 |
39 |

Detecting WCPP utility at client side...

40 |

Please wait a few seconds...

41 |
42 |
43 | 60 | 61 | 62 | 63 | 64 | @section scripts { 65 | 66 | 67 | 68 | 89 | 90 | 91 | @* WCPP detection script generated by HomeController *@ 92 | 93 | @Html.Raw(ViewData["WCPPDetectionScript"]) 94 | 95 | } -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Views/Home/Samples.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewData["Title"] = "Samples"; 4 | Layout = "~/Views/Shared/_Layout.cshtml"; 5 | } 6 | 7 |

Available Samples

8 | 9 |
10 |
11 |
12 |

13 |  Raw Data Printing 14 |

15 |

16 | Send any raw data & commands supported by the client printer like Epson ESC/POS, HP PCL, PostScript, Zebra ZPL and Eltron EPL, and more! 17 |

18 |
19 |
20 |

21 |  Print Files 22 |

23 |

24 | Print PDF, TXT, DOC, XLS, JPG & PNG images to a client printer without displaying any Print dialog! 25 |

26 |
27 |
28 |

29 |  Printers Info 30 |

31 |

32 | Collect many useful info from all the installed printers in the client machine. 33 |

34 |
35 |
36 |
37 |
38 |

39 |  Advanced PDF Printing 40 |

41 |

42 | Print PDF files specifying advanced settings like tray, paper source, print rotation, duplex printing, pages range and more! 43 |

44 |
45 |
46 |

47 |  Advanced DOC Printing 48 |

49 |

50 | Print DOC files specifying advanced settings like duplex printing, pages range, print in reverse and more! Windows Only 51 |

52 |
53 |
54 |

55 |  Advanced XLS Printing 56 |

57 |

58 | Print XLS files specifying advanced settings like pages range (From - To) and more! Windows Only 59 |

60 |
61 |
62 |
63 |
64 |

65 |  Print Files With Encryption 66 |

67 |

68 | Encrypt and Print PDF, TXT, JPG & PNG files! 69 |

70 |
71 |
72 |

73 |  Print Files With Password Protection 74 |

75 |

76 | Print Password Protected PDF, DOC & XLS files! 77 |

78 |
79 |
80 |
81 | 82 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 22 |

23 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WCPAspNetCoreMvcCS 2 | @using WCPAspNetCoreMvcCS.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/WCPAspNetCoreMvcCS.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/GuidingPrinciplesBusinessHR_EN.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/GuidingPrinciplesBusinessHR_EN.pdf -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/LoremIpsum-PasswordProtected.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/LoremIpsum-PasswordProtected.doc -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/LoremIpsum-PasswordProtected.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/LoremIpsum-PasswordProtected.pdf -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/LoremIpsum.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/LoremIpsum.doc -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/LoremIpsum.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/LoremIpsum.pdf -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/LoremIpsum.txt: -------------------------------------------------------------------------------- 1 | Printed By WebClientPrint 2 | ========================= 3 | 4 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce urna massa, eleifend non posuere quis, iaculis et libero. Curabitur lacinia dolor non nisl pharetra tempus. Nunc non purus eget lacus sollicitudin commodo sit amet non magna. Sed euismod massa id justo pellentesque interdum. Ut a nisi aliquam augue blandit facilisis semper eu enim. Vivamus cursus sollicitudin orci vitae elementum. Nulla ornare tortor vitae arcu suscipit eu vestibulum diam auctor. Nullam convallis sem eget velit interdum id commodo arcu condimentum. Vestibulum egestas, odio nec volutpat placerat, tellus massa rhoncus turpis, id posuere est justo ut ante. 5 | 6 | Aenean vel lacus diam. Curabitur nec ligula felis. Donec ut enim id orci aliquet tincidunt. Proin feugiat sapien at tellus viverra in porttitor magna fermentum. Sed vel sapien quis turpis semper condimentum sit amet vel tellus. Pellentesque et lorem sed lorem congue ultricies tempus nec sapien. Donec sed lectus id urna pellentesque hendrerit. Mauris pretium, justo ut varius tincidunt, purus elit tempus nibh, in ullamcorper dui est ut eros. Phasellus eget augue quis urna consequat iaculis. Aliquam ac consequat mi. Nullam lectus odio, sodales vitae dictum a, bibendum vel nisl. 7 | 8 | Nulla ut vestibulum lorem. Aliquam vel consectetur mi. Aliquam pretium dui non nunc cursus ut blandit sapien sodales. Aliquam dictum pellentesque ligula, quis mollis magna ullamcorper nec. Etiam fermentum adipiscing nibh, vitae mattis quam vestibulum non. Pellentesque volutpat lorem vel nisl luctus scelerisque. Nulla vitae mauris a orci vestibulum auctor. Phasellus vehicula dictum eros, quis porta libero cursus in. Ut sit amet tempus ante. Nulla sit amet congue libero. Aliquam erat volutpat. Phasellus lacus dolor, varius sit amet vestibulum varius, pretium nec felis. Vivamus sed vehicula magna. Praesent et mi vel magna fringilla posuere. Curabitur nunc est, scelerisque ut luctus tincidunt, blandit ac diam. 9 | 10 | Maecenas consequat consectetur nulla, id dignissim mauris volutpat ac. In mattis convallis ornare. Ut condimentum vestibulum mi id aliquam. Mauris lacinia accumsan neque vitae malesuada. Praesent dignissim diam eu mi adipiscing vehicula. Proin egestas, justo interdum convallis vehicula, elit massa eleifend arcu, tincidunt mattis neque elit ut eros. Duis neque neque, tincidunt ut venenatis eu, blandit eget massa. Aliquam sit amet ligula convallis dolor porta placerat et sed arcu. Ut suscipit urna et nisi dictum placerat. Phasellus a nisl mi. Ut ut nunc ut metus tempor iaculis sit amet eu magna. Phasellus risus eros, volutpat eu tempor sit amet, volutpat venenatis nisl. 11 | 12 | Aliquam scelerisque commodo justo, a dictum metus dapibus vel. Aenean ac volutpat velit. Proin semper euismod velit sit amet mattis. Cras ut dolor arcu. Nullam hendrerit sagittis elit vel dictum. Etiam nisl nisi, eleifend vel molestie tincidunt, porttitor ac nunc. Vestibulum vulputate magna gravida neque imperdiet ac viverra nulla suscipit. -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/Project-Scheduling-Monitoring-Tool.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/Project-Scheduling-Monitoring-Tool.xls -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/Sample-Employee-Handbook.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/Sample-Employee-Handbook.doc -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/SamplePngImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/SamplePngImage.png -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/SampleSheet-PasswordProtected.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/SampleSheet-PasswordProtected.xls -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/SampleSheet.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/SampleSheet.xls -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/mixed-page-orientation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/mixed-page-orientation.pdf -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/patent2pages.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/patent2pages.tif -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/files/penguins300dpi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/files/penguins300dpi.jpg -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\ 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | body { 4 | padding-top: 50px; 5 | padding-bottom: 20px; 6 | } 7 | 8 | /* Wrapping element */ 9 | /* Set some basic padding to keep content from hitting the edges */ 10 | .body-content { 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | } 14 | 15 | /* Carousel */ 16 | .carousel-caption p { 17 | font-size: 20px; 18 | line-height: 1.4; 19 | } 20 | 21 | /* Make .svg files in the carousel display properly in older browsers */ 22 | .carousel-inner .item img[src$=".svg"] { 23 | width: 100%; 24 | } 25 | 26 | /* QR code generator */ 27 | #qrCode { 28 | margin: 15px; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/wwwroot/favicon.ico -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPAspNetCoreMvcCS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /WCPAspNetCoreMvcCS/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /WCPMVCCS/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace WCPMVCCS 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at https://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js")); 24 | 25 | bundles.Add(new StyleBundle("~/Content/css").Include( 26 | "~/Content/bootstrap.css", 27 | "~/Content/site.css")); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /WCPMVCCS/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace WCPMVCCS 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /WCPMVCCS/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace WCPMVCCS 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /WCPMVCCS/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* Set width on the form input elements since they're 100% wide by default */ 20 | input, 21 | select, 22 | textarea { 23 | max-width: 280px; 24 | } 25 | -------------------------------------------------------------------------------- /WCPMVCCS/Controllers/DemoPrintFileDOCController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | using Neodynamic.SDK.Web; 8 | 9 | namespace WCPMVCCS.Controllers 10 | { 11 | public class DemoPrintFileDOCController : Controller 12 | { 13 | // GET: DemoPrintFile 14 | public ActionResult Index() 15 | { 16 | ViewBag.WCPScript = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, HttpContext.Request.Url.Scheme), Url.Action("PrintFile", "DemoPrintFileDOC", null, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID); 17 | 18 | return View(); 19 | } 20 | 21 | [AllowAnonymous] 22 | public void PrintFile(string printerName, string pagesRange, string printInReverseOrder, string duplexPrinting) 23 | { 24 | string fileName = Guid.NewGuid().ToString("N"); 25 | string filePath = filePath = "~/files/Sample-Employee-Handbook.doc"; 26 | 27 | PrintFileDOC file = new PrintFileDOC(System.Web.HttpContext.Current.Server.MapPath(filePath), fileName); 28 | file.PagesRange = pagesRange; 29 | file.PrintInReverseOrder = (printInReverseOrder == "true"); 30 | file.DuplexPrinting = (duplexPrinting == "true"); 31 | //file.DuplexPrintingDialogMessage = "Your custom dialog message for duplex printing"; 32 | 33 | ClientPrintJob cpj = new ClientPrintJob(); 34 | cpj.PrintFile = file; 35 | if (printerName == "null") 36 | cpj.ClientPrinter = new DefaultPrinter(); 37 | else 38 | { 39 | cpj.ClientPrinter = new InstalledPrinter(printerName); 40 | } 41 | 42 | 43 | System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream"; 44 | System.Web.HttpContext.Current.Response.BinaryWrite(cpj.GetContent()); 45 | System.Web.HttpContext.Current.Response.End(); 46 | 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /WCPMVCCS/Controllers/DemoPrintFilePDFController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | using Neodynamic.SDK.Web; 8 | 9 | namespace WCPMVCCS.Controllers 10 | { 11 | public class DemoPrintFilePDFController : Controller 12 | { 13 | // GET: DemoPrintFile 14 | public ActionResult Index() 15 | { 16 | ViewBag.WCPScript = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, HttpContext.Request.Url.Scheme), Url.Action("PrintFile", "DemoPrintFilePDF", null, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID); 17 | 18 | return View(); 19 | } 20 | 21 | [AllowAnonymous] 22 | public void PrintFile(string printerName, string trayName, string paperName, string printRotation, string pagesRange, string printAnnotations, string printAsGrayscale, string printInReverseOrder, string manualDuplexPrinting, string driverDuplexPrinting, string pageSizing, bool autoRotate, bool autoCenter) 23 | { 24 | if (manualDuplexPrinting == "true" && driverDuplexPrinting == "true") 25 | { 26 | manualDuplexPrinting = "false"; 27 | } 28 | 29 | string fileName = Guid.NewGuid().ToString("N"); 30 | string filePath = filePath = "~/files/mixed-page-orientation.pdf"; 31 | 32 | PrintFilePDF file = new PrintFilePDF(System.Web.HttpContext.Current.Server.MapPath(filePath), fileName); 33 | file.PrintRotation = (PrintRotation)Enum.Parse(typeof(PrintRotation), printRotation); ; 34 | file.PagesRange = pagesRange; 35 | file.PrintAnnotations = (printAnnotations == "true"); 36 | file.PrintAsGrayscale = (printAsGrayscale == "true"); 37 | file.PrintInReverseOrder = (printInReverseOrder == "true"); 38 | if (manualDuplexPrinting == "true") 39 | { 40 | file.DuplexPrinting = true; 41 | //file.DuplexPrintingDialogMessage = "Your custom dialog message for duplex printing"; 42 | } 43 | file.Sizing = (Sizing)Enum.Parse(typeof(Sizing), pageSizing); 44 | file.AutoCenter = autoCenter; 45 | file.AutoRotate = autoRotate; 46 | 47 | ClientPrintJob cpj = new ClientPrintJob(); 48 | cpj.PrintFile = file; 49 | if (printerName == "null") 50 | cpj.ClientPrinter = new DefaultPrinter(); 51 | else 52 | { 53 | if (trayName == "null") trayName = ""; 54 | if (paperName == "null") paperName = ""; 55 | 56 | cpj.ClientPrinter = new InstalledPrinter(printerName, true, trayName, paperName); 57 | 58 | if (driverDuplexPrinting == "true") 59 | ((InstalledPrinter)cpj.ClientPrinter).Duplex = Duplex.Vertical; 60 | } 61 | 62 | 63 | System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream"; 64 | System.Web.HttpContext.Current.Response.BinaryWrite(cpj.GetContent()); 65 | System.Web.HttpContext.Current.Response.End(); 66 | 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /WCPMVCCS/Controllers/DemoPrintFileXLSController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | using Neodynamic.SDK.Web; 8 | 9 | namespace WCPMVCCS.Controllers 10 | { 11 | public class DemoPrintFileXLSController : Controller 12 | { 13 | // GET: DemoPrintFile 14 | public ActionResult Index() 15 | { 16 | ViewBag.WCPScript = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, HttpContext.Request.Url.Scheme), Url.Action("PrintFile", "DemoPrintFileXLS", null, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID); 17 | 18 | return View(); 19 | } 20 | 21 | [AllowAnonymous] 22 | public void PrintFile(string printerName, string pagesFrom, string pagesTo) 23 | { 24 | string fileName = Guid.NewGuid().ToString("N"); 25 | string filePath = "~/files/Project-Scheduling-Monitoring-Tool.xls"; 26 | 27 | PrintFileXLS file = new PrintFileXLS(System.Web.HttpContext.Current.Server.MapPath(filePath), fileName); 28 | if (string.IsNullOrEmpty(pagesFrom) == false) 29 | file.PagesFrom = int.Parse(pagesFrom); 30 | if (string.IsNullOrEmpty(pagesTo) == false) 31 | file.PagesTo = int.Parse(pagesTo); 32 | 33 | ClientPrintJob cpj = new ClientPrintJob(); 34 | cpj.PrintFile = file; 35 | if (printerName == "null") 36 | cpj.ClientPrinter = new DefaultPrinter(); 37 | else 38 | { 39 | cpj.ClientPrinter = new InstalledPrinter(printerName); 40 | } 41 | 42 | 43 | System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream"; 44 | System.Web.HttpContext.Current.Response.BinaryWrite(cpj.GetContent()); 45 | System.Web.HttpContext.Current.Response.End(); 46 | 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /WCPMVCCS/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | 7 | namespace WCPMVCCS.Controllers 8 | { 9 | public class HomeController : Controller 10 | { 11 | public ActionResult Index() 12 | { 13 | 14 | ViewBag.WCPPDetectionScript = Neodynamic.SDK.Web.WebClientPrint.CreateWcppDetectionScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID); 15 | 16 | return View(); 17 | } 18 | 19 | public ActionResult Samples() 20 | { 21 | return View(); 22 | } 23 | 24 | public ActionResult PrintersInfo() 25 | { 26 | ViewBag.WCPScript = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, HttpContext.Request.Url.Scheme), "", HttpContext.Session.SessionID); 27 | 28 | return View(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /WCPMVCCS/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="WCPMVCCS.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /WCPMVCCS/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Optimization; 7 | using System.Web.Routing; 8 | 9 | namespace WCPMVCCS 10 | { 11 | public class MvcApplication : System.Web.HttpApplication 12 | { 13 | protected void Application_Start() 14 | { 15 | AreaRegistration.RegisterAllAreas(); 16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 17 | RouteConfig.RegisterRoutes(RouteTable.Routes); 18 | BundleConfig.RegisterBundles(BundleTable.Bundles); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /WCPMVCCS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WCPMVCCS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("WCPMVCCS")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c9c0de7a-3806-4e21-8fcc-b35858b38e00")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /WCPMVCCS/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Home Page"; 3 | } 4 | 5 | @section styles{ 6 | 7 | 21 | 22 | } 23 | 24 | 25 |
26 |
27 |
28 |

Detecting WCPP utility at client side...

29 |

Please wait a few seconds...

30 |
31 |
32 | 49 | 50 | @section scripts{ 51 | 52 | 79 | 80 | 81 | @* WCPP detection script generated by HomeController *@ 82 | 83 | @Html.Raw(ViewBag.WCPPDetectionScript) 84 | 85 | 86 | } -------------------------------------------------------------------------------- /WCPMVCCS/Views/Home/Samples.cshtml: -------------------------------------------------------------------------------- 1 |  2 | @{ 3 | ViewBag.Title = "Printing Samples"; 4 | } 5 | 6 |

Available Samples

7 | 8 |
9 |
10 |
11 |

12 |  Raw Data Printing 13 |

14 |

15 | Send any raw data & commands supported by the client printer like Epson ESC/POS, HP PCL, PostScript, Zebra ZPL and Eltron EPL, and more! 16 |

17 |
18 |
19 |

20 |  Print Files 21 |

22 |

23 | Print PDF, TXT, DOC, XLS, JPG & PNG images to a client printer without displaying any Print dialog! 24 |

25 |
26 |
27 |

28 |  Printers Info 29 |

30 |

31 | Collect many useful info from all the installed printers in the client machine. 32 |

33 |
34 |
35 |
36 |
37 |

38 |  Advanced PDF Printing 39 |

40 |

41 | Print PDF files specifying advanced settings like tray, paper source, print rotation, duplex printing, pages range and more! 42 |

43 |
44 |
45 |

46 |  Advanced DOC Printing 47 |

48 |

49 | Print DOC files specifying advanced settings like duplex printing, pages range, print in reverse and more! Windows Only 50 |

51 |
52 |
53 |

54 |  Advanced XLS Printing 55 |

56 |

57 | Print XLS files specifying advanced settings like pages range (From - To) and more! Windows Only 58 |

59 |
60 |
61 |
62 |
63 |

64 |  Print Files With Encryption 65 |

66 |

67 | Encrypt and Print PDF, TXT, JPG & PNG files! 68 |

69 |
70 |
71 |

72 |  Print Files With Password Protection 73 |

74 |

75 | Print Password Protected PDF, DOC & XLS files! 76 |

77 |
78 |
79 |
80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /WCPMVCCS/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Error 6 | 7 | 8 |
9 |

Error.

10 |

An error occurred while processing your request.

11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /WCPMVCCS/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /WCPMVCCS/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /WCPMVCCS/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /WCPMVCCS/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /WCPMVCCS/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /WCPMVCCS/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/favicon.ico -------------------------------------------------------------------------------- /WCPMVCCS/files/GuidingPrinciplesBusinessHR_EN.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/GuidingPrinciplesBusinessHR_EN.pdf -------------------------------------------------------------------------------- /WCPMVCCS/files/LoremIpsum-PasswordProtected.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/LoremIpsum-PasswordProtected.doc -------------------------------------------------------------------------------- /WCPMVCCS/files/LoremIpsum-PasswordProtected.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/LoremIpsum-PasswordProtected.pdf -------------------------------------------------------------------------------- /WCPMVCCS/files/LoremIpsum.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/LoremIpsum.doc -------------------------------------------------------------------------------- /WCPMVCCS/files/LoremIpsum.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/LoremIpsum.pdf -------------------------------------------------------------------------------- /WCPMVCCS/files/LoremIpsum.txt: -------------------------------------------------------------------------------- 1 | Printed By WebClientPrint 2 | ========================= 3 | 4 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce urna massa, eleifend non posuere quis, iaculis et libero. Curabitur lacinia dolor non nisl pharetra tempus. Nunc non purus eget lacus sollicitudin commodo sit amet non magna. Sed euismod massa id justo pellentesque interdum. Ut a nisi aliquam augue blandit facilisis semper eu enim. Vivamus cursus sollicitudin orci vitae elementum. Nulla ornare tortor vitae arcu suscipit eu vestibulum diam auctor. Nullam convallis sem eget velit interdum id commodo arcu condimentum. Vestibulum egestas, odio nec volutpat placerat, tellus massa rhoncus turpis, id posuere est justo ut ante. 5 | 6 | Aenean vel lacus diam. Curabitur nec ligula felis. Donec ut enim id orci aliquet tincidunt. Proin feugiat sapien at tellus viverra in porttitor magna fermentum. Sed vel sapien quis turpis semper condimentum sit amet vel tellus. Pellentesque et lorem sed lorem congue ultricies tempus nec sapien. Donec sed lectus id urna pellentesque hendrerit. Mauris pretium, justo ut varius tincidunt, purus elit tempus nibh, in ullamcorper dui est ut eros. Phasellus eget augue quis urna consequat iaculis. Aliquam ac consequat mi. Nullam lectus odio, sodales vitae dictum a, bibendum vel nisl. 7 | 8 | Nulla ut vestibulum lorem. Aliquam vel consectetur mi. Aliquam pretium dui non nunc cursus ut blandit sapien sodales. Aliquam dictum pellentesque ligula, quis mollis magna ullamcorper nec. Etiam fermentum adipiscing nibh, vitae mattis quam vestibulum non. Pellentesque volutpat lorem vel nisl luctus scelerisque. Nulla vitae mauris a orci vestibulum auctor. Phasellus vehicula dictum eros, quis porta libero cursus in. Ut sit amet tempus ante. Nulla sit amet congue libero. Aliquam erat volutpat. Phasellus lacus dolor, varius sit amet vestibulum varius, pretium nec felis. Vivamus sed vehicula magna. Praesent et mi vel magna fringilla posuere. Curabitur nunc est, scelerisque ut luctus tincidunt, blandit ac diam. 9 | 10 | Maecenas consequat consectetur nulla, id dignissim mauris volutpat ac. In mattis convallis ornare. Ut condimentum vestibulum mi id aliquam. Mauris lacinia accumsan neque vitae malesuada. Praesent dignissim diam eu mi adipiscing vehicula. Proin egestas, justo interdum convallis vehicula, elit massa eleifend arcu, tincidunt mattis neque elit ut eros. Duis neque neque, tincidunt ut venenatis eu, blandit eget massa. Aliquam sit amet ligula convallis dolor porta placerat et sed arcu. Ut suscipit urna et nisi dictum placerat. Phasellus a nisl mi. Ut ut nunc ut metus tempor iaculis sit amet eu magna. Phasellus risus eros, volutpat eu tempor sit amet, volutpat venenatis nisl. 11 | 12 | Aliquam scelerisque commodo justo, a dictum metus dapibus vel. Aenean ac volutpat velit. Proin semper euismod velit sit amet mattis. Cras ut dolor arcu. Nullam hendrerit sagittis elit vel dictum. Etiam nisl nisi, eleifend vel molestie tincidunt, porttitor ac nunc. Vestibulum vulputate magna gravida neque imperdiet ac viverra nulla suscipit. -------------------------------------------------------------------------------- /WCPMVCCS/files/Sample-Employee-Handbook.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/Sample-Employee-Handbook.doc -------------------------------------------------------------------------------- /WCPMVCCS/files/SamplePngImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/SamplePngImage.png -------------------------------------------------------------------------------- /WCPMVCCS/files/SampleSheet-PasswordProtected.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/SampleSheet-PasswordProtected.xls -------------------------------------------------------------------------------- /WCPMVCCS/files/SampleSheet.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/SampleSheet.xls -------------------------------------------------------------------------------- /WCPMVCCS/files/mixed-page-orientation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/mixed-page-orientation.pdf -------------------------------------------------------------------------------- /WCPMVCCS/files/mod1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/mod1.pdf -------------------------------------------------------------------------------- /WCPMVCCS/files/patent2pages.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/patent2pages.tif -------------------------------------------------------------------------------- /WCPMVCCS/files/penguins300dpi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/files/penguins300dpi.jpg -------------------------------------------------------------------------------- /WCPMVCCS/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /WCPMVCCS/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /WCPMVCCS/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /WCPMVCCS/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCCS/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /WCPMVCCS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /WCPMVCVB/App_Start/BundleConfig.vb: -------------------------------------------------------------------------------- 1 | Imports System.Web.Optimization 2 | 3 | Public Module BundleConfig 4 | ' For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 5 | Public Sub RegisterBundles(ByVal bundles As BundleCollection) 6 | 7 | bundles.Add(New ScriptBundle("~/bundles/jquery").Include( 8 | "~/Scripts/jquery-{version}.js")) 9 | 10 | bundles.Add(New ScriptBundle("~/bundles/jqueryval").Include( 11 | "~/Scripts/jquery.validate*")) 12 | 13 | ' Use the development version of Modernizr to develop with and learn from. Then, when you're 14 | ' ready for production, use the build tool at https://modernizr.com to pick only the tests you need. 15 | bundles.Add(New ScriptBundle("~/bundles/modernizr").Include( 16 | "~/Scripts/modernizr-*")) 17 | 18 | bundles.Add(New ScriptBundle("~/bundles/bootstrap").Include( 19 | "~/Scripts/bootstrap.js")) 20 | 21 | bundles.Add(New StyleBundle("~/Content/css").Include( 22 | "~/Content/bootstrap.css", 23 | "~/Content/site.css")) 24 | End Sub 25 | End Module 26 | 27 | -------------------------------------------------------------------------------- /WCPMVCVB/App_Start/FilterConfig.vb: -------------------------------------------------------------------------------- 1 | Imports System.Web 2 | Imports System.Web.Mvc 3 | 4 | Public Module FilterConfig 5 | Public Sub RegisterGlobalFilters(ByVal filters As GlobalFilterCollection) 6 | filters.Add(New HandleErrorAttribute()) 7 | End Sub 8 | End Module -------------------------------------------------------------------------------- /WCPMVCVB/App_Start/RouteConfig.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Collections.Generic 3 | Imports System.Linq 4 | Imports System.Web 5 | Imports System.Web.Mvc 6 | Imports System.Web.Routing 7 | 8 | Public Module RouteConfig 9 | Public Sub RegisterRoutes(ByVal routes As RouteCollection) 10 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}") 11 | 12 | routes.MapRoute( 13 | name:="Default", 14 | url:="{controller}/{action}/{id}", 15 | defaults:=New With {.controller = "Home", .action = "Index", .id = UrlParameter.Optional} 16 | ) 17 | End Sub 18 | End Module -------------------------------------------------------------------------------- /WCPMVCVB/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* Set width on the form input elements since they're 100% wide by default */ 20 | input, 21 | select, 22 | textarea { 23 | max-width: 280px; 24 | } 25 | -------------------------------------------------------------------------------- /WCPMVCVB/Controllers/DemoPrintFileController.vb: -------------------------------------------------------------------------------- 1 | Imports System.Web.Mvc 2 | 3 | Imports Neodynamic.SDK.Web 4 | 5 | Namespace Controllers 6 | Public Class DemoPrintFileController 7 | Inherits Controller 8 | 9 | ' GET: DemoPrintFile 10 | Function Index() As ActionResult 11 | 12 | ViewData("WCPScript") = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", Nothing, HttpContext.Request.Url.Scheme), Url.Action("PrintFile", "DemoPrintFile", Nothing, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID) 13 | 14 | Return View() 15 | End Function 16 | 17 | Public Sub PrintFile(useDefaultPrinter As String, printerName As String, fileType As String) 18 | 19 | Dim fileName As String = Guid.NewGuid().ToString("N") + "." + fileType 20 | Dim filePath As String = Nothing 21 | Select Case fileType 22 | 23 | Case "PDF" 24 | filePath = "~/files/LoremIpsum.pdf" 25 | 26 | Case "TXT" 27 | filePath = "~/files/LoremIpsum.txt" 28 | 29 | Case "DOC" 30 | filePath = "~/files/LoremIpsum.doc" 31 | 32 | Case "XLS" 33 | filePath = "~/files/SampleSheet.xls" 34 | 35 | Case "JPG" 36 | filePath = "~/files/penguins300dpi.jpg" 37 | 38 | Case "PNG" 39 | filePath = "~/files/SamplePngImage.png" 40 | 41 | Case "TIF" 42 | filePath = "~/files/patent2pages.tif" 43 | 44 | End Select 45 | 46 | 47 | If (filePath <> Nothing) Then 48 | Dim file As PrintFile 49 | If (fileType = "PDF") Then 50 | file = New PrintFilePDF(System.Web.HttpContext.Current.Server.MapPath(filePath), fileName) 51 | DirectCast(file, PrintFilePDF).PrintRotation = PrintRotation.None 52 | 'DirectCast(file, PrintFilePDF).PagesRange = "1,2,3,10-15" 53 | 'DirectCast(file, PrintFilePDF).PrintAnnotations = True 54 | 'DirectCast(file, PrintFilePDF).PrintAsGrayscale = True 55 | 'DirectCast(file, PrintFilePDF).PrintInReverseOrder = True 56 | ElseIf (fileType = "TXT") Then 57 | file = New PrintFileTXT(System.Web.HttpContext.Current.Server.MapPath(filePath), fileName) 58 | DirectCast(file, PrintFileTXT).PrintOrientation = PrintOrientation.Portrait 59 | DirectCast(file, PrintFileTXT).FontName = "Arial" 60 | DirectCast(file, PrintFileTXT).FontSizeInPoints = 12 ' Point Unit!!! 61 | 'DirectCast(file, PrintFileTXT).TextColor = "#ff00ff" 62 | 'DirectCast(file, PrintFileTXT).TextAlignment = TextAlignment.Center 63 | 'DirectCast(file, PrintFileTXT).FontBold = True 64 | 'DirectCast(file, PrintFileTXT).FontItalic = True 65 | 'DirectCast(file, PrintFileTXT).FontUnderline = True 66 | 'DirectCast(file, PrintFileTXT).FontStrikeThrough = True 67 | 'DirectCast(file, PrintFileTXT).MarginLeft = 1 ' INCH Unit!!! 68 | 'DirectCast(file, PrintFileTXT).MarginTop = 1 ' INCH Unit!!! 69 | 'DirectCast(file, PrintFileTXT).MarginRight = 1 ' INCH Unit!!! 70 | 'DirectCast(file, PrintFileTXT).MarginBottom = 1 ' INCH Unit!!! 71 | Else 72 | file = New PrintFile(System.Web.HttpContext.Current.Server.MapPath(filePath), fileName) 73 | End If 74 | 75 | Dim cpj As New ClientPrintJob() 76 | cpj.PrintFile = file 77 | If (useDefaultPrinter = "checked" OrElse printerName = "null") Then 78 | cpj.ClientPrinter = New DefaultPrinter() 79 | Else 80 | cpj.ClientPrinter = New InstalledPrinter(System.Web.HttpUtility.UrlDecode(printerName)) 81 | End If 82 | 83 | System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream" 84 | System.Web.HttpContext.Current.Response.BinaryWrite(cpj.GetContent()) 85 | System.Web.HttpContext.Current.Response.End() 86 | 87 | End If 88 | 89 | 90 | End Sub 91 | End Class 92 | End Namespace -------------------------------------------------------------------------------- /WCPMVCVB/Controllers/DemoPrintFileDOCController.vb: -------------------------------------------------------------------------------- 1 | Imports System.Web.Mvc 2 | 3 | Imports Neodynamic.SDK.Web 4 | 5 | 6 | Namespace Controllers 7 | Public Class DemoPrintFileDOCController 8 | Inherits Controller 9 | 10 | ' GET: DemoPrintFilePDF 11 | Function Index() As ActionResult 12 | 13 | ViewData("WCPScript") = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", Nothing, HttpContext.Request.Url.Scheme), Url.Action("PrintFile", "DemoPrintFileDOC", Nothing, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID) 14 | 15 | Return View() 16 | End Function 17 | 18 | 19 | Public Sub PrintFile(printerName As String, pagesRange As String, printInReverseOrder As String, duplexPrinting As String) 20 | 21 | Dim fileName As String = Guid.NewGuid().ToString("N") 22 | Dim filePath As String = "~/files/Sample-Employee-Handbook.doc" 23 | 24 | Dim File As New PrintFileDOC(System.Web.HttpContext.Current.Server.MapPath(filePath), fileName) 25 | File.PagesRange = pagesRange 26 | File.PrintInReverseOrder = (printInReverseOrder = "true") 27 | File.DuplexPrinting = (duplexPrinting = "true") 28 | File.DuplexPrintingDialogMessage = "Your custom dialog message for duplex printing" 29 | 30 | Dim cpj As New ClientPrintJob() 31 | cpj.PrintFile = File 32 | If (printerName = "null") Then 33 | cpj.ClientPrinter = New DefaultPrinter() 34 | Else 35 | cpj.ClientPrinter = New InstalledPrinter(printerName) 36 | End If 37 | 38 | System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream" 39 | System.Web.HttpContext.Current.Response.BinaryWrite(cpj.GetContent()) 40 | System.Web.HttpContext.Current.Response.End() 41 | 42 | End Sub 43 | 44 | End Class 45 | End Namespace -------------------------------------------------------------------------------- /WCPMVCVB/Controllers/DemoPrintFilePDFController.vb: -------------------------------------------------------------------------------- 1 | Imports System.Web.Mvc 2 | 3 | Imports Neodynamic.SDK.Web 4 | 5 | 6 | Namespace Controllers 7 | Public Class DemoPrintFilePDFController 8 | Inherits Controller 9 | 10 | ' GET: DemoPrintFilePDF 11 | Function Index() As ActionResult 12 | 13 | ViewData("WCPScript") = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", Nothing, HttpContext.Request.Url.Scheme), Url.Action("PrintFile", "DemoPrintFilePDF", Nothing, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID) 14 | 15 | Return View() 16 | End Function 17 | 18 | 19 | Public Sub PrintFile(printerName As String, trayName As String, paperName As String, printRotation As String, pagesRange As String, printAnnotations As String, printAsGrayscale As String, printInReverseOrder As String, manualDuplexPrinting As String, driverDuplexPrinting As String, pageSizing As String, autoRotate As Boolean, autoCenter As Boolean) 20 | 21 | If (manualDuplexPrinting = "true" AndAlso driverDuplexPrinting = "true") Then 22 | manualDuplexPrinting = "false" 23 | End If 24 | 25 | Dim fileName As String = Guid.NewGuid().ToString("N") 26 | Dim filePath As String = "~/files/mixed-page-orientation.pdf" 27 | 28 | Dim File As New PrintFilePDF(System.Web.HttpContext.Current.Server.MapPath(filePath), fileName) 29 | File.PrintRotation = [Enum].Parse(GetType(PrintRotation), printRotation) 30 | File.PagesRange = pagesRange 31 | File.PrintAnnotations = (printAnnotations = "true") 32 | File.PrintAsGrayscale = (printAsGrayscale = "true") 33 | File.PrintInReverseOrder = (printInReverseOrder = "true") 34 | If (manualDuplexPrinting = "true") Then 35 | File.DuplexPrinting = True 36 | File.DuplexPrintingDialogMessage = "Your custom dialog message for duplex printing" 37 | End If 38 | File.Sizing = [Enum].Parse(GetType(Sizing), pageSizing) 39 | File.AutoCenter = autoCenter 40 | File.AutoRotate = autoRotate 41 | 42 | Dim cpj As New ClientPrintJob() 43 | cpj.PrintFile = File 44 | If (printerName = "null") Then 45 | cpj.ClientPrinter = New DefaultPrinter() 46 | Else 47 | If (trayName = "null") Then trayName = "" 48 | If (paperName = "null") Then paperName = "" 49 | 50 | cpj.ClientPrinter = New InstalledPrinter(printerName, True, trayName, paperName) 51 | 52 | If (driverDuplexPrinting = "true") Then 53 | DirectCast(cpj.ClientPrinter, InstalledPrinter).Duplex = Duplex.Vertical 54 | End If 55 | 56 | End If 57 | 58 | System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream" 59 | System.Web.HttpContext.Current.Response.BinaryWrite(cpj.GetContent()) 60 | System.Web.HttpContext.Current.Response.End() 61 | 62 | End Sub 63 | 64 | End Class 65 | End Namespace -------------------------------------------------------------------------------- /WCPMVCVB/Controllers/DemoPrintFileXLSController.vb: -------------------------------------------------------------------------------- 1 | Imports System.Web.Mvc 2 | 3 | Imports Neodynamic.SDK.Web 4 | 5 | 6 | Namespace Controllers 7 | Public Class DemoPrintFileXLSController 8 | Inherits Controller 9 | 10 | ' GET: DemoPrintFilePDF 11 | Function Index() As ActionResult 12 | 13 | ViewData("WCPScript") = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", Nothing, HttpContext.Request.Url.Scheme), Url.Action("PrintFile", "DemoPrintFileXLS", Nothing, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID) 14 | 15 | Return View() 16 | End Function 17 | 18 | 19 | Public Sub PrintFile(printerName As String, pagesFrom As String, pagesTo As String) 20 | 21 | Dim fileName As String = Guid.NewGuid().ToString("N") 22 | Dim filePath As String = "~/files/Project-Scheduling-Monitoring-Tool.xls" 23 | 24 | Dim File As New PrintFileXLS(System.Web.HttpContext.Current.Server.MapPath(filePath), fileName) 25 | If (String.IsNullOrEmpty(pagesFrom) = False) Then 26 | File.PagesFrom = Integer.Parse(pagesFrom) 27 | End If 28 | If (String.IsNullOrEmpty(pagesTo) = False) Then 29 | File.PagesTo = Integer.Parse(pagesTo) 30 | End If 31 | 32 | Dim cpj As New ClientPrintJob() 33 | cpj.PrintFile = File 34 | If (printerName = "null") Then 35 | cpj.ClientPrinter = New DefaultPrinter() 36 | Else 37 | cpj.ClientPrinter = New InstalledPrinter(printerName) 38 | End If 39 | 40 | System.Web.HttpContext.Current.Response.ContentType = "application/octet-stream" 41 | System.Web.HttpContext.Current.Response.BinaryWrite(cpj.GetContent()) 42 | System.Web.HttpContext.Current.Response.End() 43 | 44 | End Sub 45 | 46 | End Class 47 | End Namespace -------------------------------------------------------------------------------- /WCPMVCVB/Controllers/HomeController.vb: -------------------------------------------------------------------------------- 1 | Public Class HomeController 2 | Inherits System.Web.Mvc.Controller 3 | Function Index() As ActionResult 4 | ViewData("WCPPDetectionScript") = Neodynamic.SDK.Web.WebClientPrint.CreateWcppDetectionScript(Url.Action("ProcessRequest", "WebClientPrintAPI", Nothing, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID) 5 | 6 | Return View() 7 | End Function 8 | 9 | Function Samples() As ActionResult 10 | 11 | Return View() 12 | End Function 13 | 14 | Function PrintersInfo() As ActionResult 15 | ViewData("WCPScript") = Neodynamic.SDK.Web.WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", Nothing, HttpContext.Request.Url.Scheme), "", HttpContext.Session.SessionID) 16 | 17 | Return View() 18 | End Function 19 | End Class 20 | -------------------------------------------------------------------------------- /WCPMVCVB/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.vb" Inherits="WCPMVCVB.MvcApplication" Language="VB" %> 2 | -------------------------------------------------------------------------------- /WCPMVCVB/Global.asax.vb: -------------------------------------------------------------------------------- 1 | Imports System.Web.Optimization 2 | 3 | Public Class MvcApplication 4 | Inherits System.Web.HttpApplication 5 | 6 | Sub Application_Start() 7 | AreaRegistration.RegisterAllAreas() 8 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters) 9 | RouteConfig.RegisterRoutes(RouteTable.Routes) 10 | BundleConfig.RegisterBundles(BundleTable.Bundles) 11 | End Sub 12 | End Class 13 | -------------------------------------------------------------------------------- /WCPMVCVB/My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.18033 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | -------------------------------------------------------------------------------- /WCPMVCVB/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 |  2 | 3 | false 4 | false 5 | 0 6 | true 7 | 0 8 | 1 9 | true 10 | 11 | -------------------------------------------------------------------------------- /WCPMVCVB/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Reflection 3 | Imports System.Runtime.InteropServices 4 | 5 | ' General Information about an assembly is controlled through the following 6 | ' set of attributes. Change these attribute values to modify the information 7 | ' associated with an assembly. 8 | 9 | ' Review the values of the assembly attributes 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | ' The following GUID is for the ID of the typelib if this project is exposed to COM 20 | 21 | 22 | ' Version information for an assembly consists of the following four values: 23 | ' 24 | ' Major Version 25 | ' Minor Version 26 | ' Build Number 27 | ' Revision 28 | ' 29 | ' You can specify all the values or you can default the Build and Revision Numbers 30 | ' by using the '*' as shown below: 31 | ' 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /WCPMVCVB/My Project/Resources.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.18033 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My.Resources 16 | 17 | 'This class was auto-generated by the StronglyTypedResourceBuilder 18 | 'class via a tool like ResGen or Visual Studio. 19 | 'To add or remove a member, edit your .ResX file then rerun ResGen 20 | 'with the /str option, or rebuild your VS project. 21 | ' 22 | ' A strongly-typed resource class, for looking up localized strings, etc. 23 | ' 24 | _ 28 | Friend Module Resources 29 | 30 | Private resourceMan As Global.System.Resources.ResourceManager 31 | 32 | Private resourceCulture As Global.System.Globalization.CultureInfo 33 | 34 | ' 35 | ' Returns the cached ResourceManager instance used by this class. 36 | ' 37 | _ 38 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager 39 | Get 40 | If Object.ReferenceEquals(resourceMan, Nothing) Then 41 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WebAPI_VB_NoAuth.Resources", GetType(Resources).Assembly) 42 | resourceMan = temp 43 | End If 44 | Return resourceMan 45 | End Get 46 | End Property 47 | 48 | ' 49 | ' Overrides the current thread's CurrentUICulture property for all 50 | ' resource lookups using this strongly typed resource class. 51 | ' 52 | _ 53 | Friend Property Culture() As Global.System.Globalization.CultureInfo 54 | Get 55 | Return resourceCulture 56 | End Get 57 | Set(ByVal value As Global.System.Globalization.CultureInfo) 58 | resourceCulture = value 59 | End Set 60 | End Property 61 | End Module 62 | End Namespace 63 | -------------------------------------------------------------------------------- /WCPMVCVB/My Project/Settings.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.18033 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My 16 | 17 | _ 20 | Partial Friend NotInheritable Class MySettings 21 | Inherits Global.System.Configuration.ApplicationSettingsBase 22 | 23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) 24 | 25 | #Region "My.Settings Auto-Save Functionality" 26 | #If _MyType = "WindowsForms" Then 27 | Private Shared addedHandler As Boolean 28 | 29 | Private Shared addedHandlerLockObject As New Object 30 | 31 | _ 32 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) 33 | If My.Application.SaveMySettingsOnExit Then 34 | My.Settings.Save() 35 | End If 36 | End Sub 37 | #End If 38 | #End Region 39 | 40 | Public Shared ReadOnly Property [Default]() As MySettings 41 | Get 42 | 43 | #If _MyType = "WindowsForms" Then 44 | If Not addedHandler Then 45 | SyncLock addedHandlerLockObject 46 | If Not addedHandler Then 47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings 48 | addedHandler = True 49 | End If 50 | End SyncLock 51 | End If 52 | #End If 53 | Return defaultInstance 54 | End Get 55 | End Property 56 | End Class 57 | End Namespace 58 | 59 | Namespace My 60 | 61 | _ 64 | Friend Module MySettingsProperty 65 | 66 | _ 67 | Friend ReadOnly Property Settings() As Global.WCPMVCVB.My.MySettings 68 | Get 69 | Return Global.WCPMVCVB.My.MySettings.Default 70 | End Get 71 | End Property 72 | End Module 73 | End Namespace 74 | -------------------------------------------------------------------------------- /WCPMVCVB/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WCPMVCVB/Views/Home/Index.vbhtml: -------------------------------------------------------------------------------- 1 | @Code 2 | ViewData("Title") = "Home Page" 3 | End Code 4 | 5 | @section styles 6 | 7 | 33 | 34 | End Section 35 | 36 | 37 |
38 |
39 |
40 |

Detecting WCPP utility at client side...

41 |

Please wait a few seconds...

42 |
43 |
44 | 61 | 62 | 63 | @section scripts 64 | 65 | 92 | 93 | 94 | @* WCPP detection script generated by HomeController *@ 95 | 96 | @Html.Raw(ViewData("WCPPDetectionScript")) 97 | 98 | 99 | } 100 | 101 | End Section -------------------------------------------------------------------------------- /WCPMVCVB/Views/Home/Samples.vbhtml: -------------------------------------------------------------------------------- 1 | @Code 2 | ViewData("Title") = "Printing Samples" 3 | End Code 4 | 5 |

Available Samples

6 | 7 |
8 |
9 |
10 |

11 |  Raw Data Printing 12 |

13 |

14 | Send any raw data & commands supported by the client printer like Epson ESC/POS, HP PCL, PostScript, Zebra ZPL and Eltron EPL, and more! 15 |

16 |
17 |
18 |

19 |  Print Files 20 |

21 |

22 | Print PDF, TXT, DOC, XLS, JPG & PNG images to a client printer without displaying any Print dialog! 23 |

24 |
25 |
26 |

27 |  Printers Info 28 |

29 |

30 | Collect many useful info from all the installed printers in the client machine. 31 |

32 |
33 |
34 |
35 |
36 |

37 |  Advanced PDF Printing 38 |

39 |

40 | Print PDF files specifying advanced settings like tray, paper source, print rotation, duplex printing, pages range and more! 41 |

42 |
43 |
44 |

45 |  Advanced DOC Printing 46 |

47 |

48 | Print DOC files specifying advanced settings like duplex printing, pages range, print in reverse and more! Windows Only 49 |

50 |
51 |
52 |

53 |  Advanced XLS Printing 54 |

55 |

56 | Print XLS files specifying advanced settings like pages range (From - To) and more! Windows Only 57 |

58 |
59 |
60 |
61 |
62 |

63 |  Print Files With Encryption 64 |

65 |

66 | Encrypt and Print PDF, TXT, JPG & PNG files! 67 |

68 |
69 |
70 |

71 |  Print Files With Password Protection 72 |

73 |

74 | Print Password Protected PDF, DOC & XLS files! 75 |

76 |
77 |
78 |
79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /WCPMVCVB/Views/Shared/Error.vbhtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Error 6 | 7 | 8 |
9 |

Error.

10 |

An error occurred while processing your request.

11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /WCPMVCVB/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /WCPMVCVB/Views/_ViewStart.vbhtml: -------------------------------------------------------------------------------- 1 | @Code 2 | Layout = "~/Views/Shared/_Layout.vbhtml" 3 | End Code -------------------------------------------------------------------------------- /WCPMVCVB/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /WCPMVCVB/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /WCPMVCVB/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /WCPMVCVB/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/favicon.ico -------------------------------------------------------------------------------- /WCPMVCVB/files/GuidingPrinciplesBusinessHR_EN.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/GuidingPrinciplesBusinessHR_EN.pdf -------------------------------------------------------------------------------- /WCPMVCVB/files/LoremIpsum-PasswordProtected.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/LoremIpsum-PasswordProtected.doc -------------------------------------------------------------------------------- /WCPMVCVB/files/LoremIpsum-PasswordProtected.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/LoremIpsum-PasswordProtected.pdf -------------------------------------------------------------------------------- /WCPMVCVB/files/LoremIpsum.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/LoremIpsum.doc -------------------------------------------------------------------------------- /WCPMVCVB/files/LoremIpsum.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/LoremIpsum.pdf -------------------------------------------------------------------------------- /WCPMVCVB/files/LoremIpsum.txt: -------------------------------------------------------------------------------- 1 | Printed By WebClientPrint 2 | ========================= 3 | 4 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce urna massa, eleifend non posuere quis, iaculis et libero. Curabitur lacinia dolor non nisl pharetra tempus. Nunc non purus eget lacus sollicitudin commodo sit amet non magna. Sed euismod massa id justo pellentesque interdum. Ut a nisi aliquam augue blandit facilisis semper eu enim. Vivamus cursus sollicitudin orci vitae elementum. Nulla ornare tortor vitae arcu suscipit eu vestibulum diam auctor. Nullam convallis sem eget velit interdum id commodo arcu condimentum. Vestibulum egestas, odio nec volutpat placerat, tellus massa rhoncus turpis, id posuere est justo ut ante. 5 | 6 | Aenean vel lacus diam. Curabitur nec ligula felis. Donec ut enim id orci aliquet tincidunt. Proin feugiat sapien at tellus viverra in porttitor magna fermentum. Sed vel sapien quis turpis semper condimentum sit amet vel tellus. Pellentesque et lorem sed lorem congue ultricies tempus nec sapien. Donec sed lectus id urna pellentesque hendrerit. Mauris pretium, justo ut varius tincidunt, purus elit tempus nibh, in ullamcorper dui est ut eros. Phasellus eget augue quis urna consequat iaculis. Aliquam ac consequat mi. Nullam lectus odio, sodales vitae dictum a, bibendum vel nisl. 7 | 8 | Nulla ut vestibulum lorem. Aliquam vel consectetur mi. Aliquam pretium dui non nunc cursus ut blandit sapien sodales. Aliquam dictum pellentesque ligula, quis mollis magna ullamcorper nec. Etiam fermentum adipiscing nibh, vitae mattis quam vestibulum non. Pellentesque volutpat lorem vel nisl luctus scelerisque. Nulla vitae mauris a orci vestibulum auctor. Phasellus vehicula dictum eros, quis porta libero cursus in. Ut sit amet tempus ante. Nulla sit amet congue libero. Aliquam erat volutpat. Phasellus lacus dolor, varius sit amet vestibulum varius, pretium nec felis. Vivamus sed vehicula magna. Praesent et mi vel magna fringilla posuere. Curabitur nunc est, scelerisque ut luctus tincidunt, blandit ac diam. 9 | 10 | Maecenas consequat consectetur nulla, id dignissim mauris volutpat ac. In mattis convallis ornare. Ut condimentum vestibulum mi id aliquam. Mauris lacinia accumsan neque vitae malesuada. Praesent dignissim diam eu mi adipiscing vehicula. Proin egestas, justo interdum convallis vehicula, elit massa eleifend arcu, tincidunt mattis neque elit ut eros. Duis neque neque, tincidunt ut venenatis eu, blandit eget massa. Aliquam sit amet ligula convallis dolor porta placerat et sed arcu. Ut suscipit urna et nisi dictum placerat. Phasellus a nisl mi. Ut ut nunc ut metus tempor iaculis sit amet eu magna. Phasellus risus eros, volutpat eu tempor sit amet, volutpat venenatis nisl. 11 | 12 | Aliquam scelerisque commodo justo, a dictum metus dapibus vel. Aenean ac volutpat velit. Proin semper euismod velit sit amet mattis. Cras ut dolor arcu. Nullam hendrerit sagittis elit vel dictum. Etiam nisl nisi, eleifend vel molestie tincidunt, porttitor ac nunc. Vestibulum vulputate magna gravida neque imperdiet ac viverra nulla suscipit. -------------------------------------------------------------------------------- /WCPMVCVB/files/Sample-Employee-Handbook.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/Sample-Employee-Handbook.doc -------------------------------------------------------------------------------- /WCPMVCVB/files/SamplePngImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/SamplePngImage.png -------------------------------------------------------------------------------- /WCPMVCVB/files/SampleSheet-PasswordProtected.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/SampleSheet-PasswordProtected.xls -------------------------------------------------------------------------------- /WCPMVCVB/files/SampleSheet.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/SampleSheet.xls -------------------------------------------------------------------------------- /WCPMVCVB/files/mixed-page-orientation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/mixed-page-orientation.pdf -------------------------------------------------------------------------------- /WCPMVCVB/files/patent2pages.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/patent2pages.tif -------------------------------------------------------------------------------- /WCPMVCVB/files/penguins300dpi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/files/penguins300dpi.jpg -------------------------------------------------------------------------------- /WCPMVCVB/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /WCPMVCVB/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /WCPMVCVB/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /WCPMVCVB/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPMVCVB/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /WCPMVCVB/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /WCPWebFormsCS/DemoPrintFileDOCHandler.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" Class="DemoPrintFileDOCHandler" %> 2 | 3 | using System; 4 | using System.Web; 5 | 6 | using Neodynamic.SDK.Web; 7 | 8 | public class DemoPrintFileDOCHandler : IHttpHandler { 9 | 10 | /*############### IMPORTANT!!! ############ 11 | If your website requires AUTHENTICATION, then you MUST configure THIS Handler file 12 | to be ANONYMOUS access allowed!!! 13 | ######################################### */ 14 | 15 | public void ProcessRequest (HttpContext context) { 16 | 17 | if (WebClientPrint.ProcessPrintJob(context.Request.Url.Query)) 18 | { 19 | 20 | string printerName = context.Server.UrlDecode(context.Request["printerName"]); 21 | string pagesRange = context.Server.UrlDecode(context.Request["pagesRange"]); 22 | 23 | bool printInReverseOrder = (context.Request["printInReverseOrder"] == "true"); 24 | bool duplexPrinting = (context.Request["duplexPrinting"] == "true"); 25 | 26 | string fileName = Guid.NewGuid().ToString("N"); 27 | string filePath = filePath = "~/files/Sample-Employee-Handbook.doc"; 28 | 29 | PrintFileDOC file = new PrintFileDOC(context.Server.MapPath(filePath), fileName); 30 | file.PagesRange = pagesRange; 31 | file.PrintInReverseOrder = printInReverseOrder; 32 | file.DuplexPrinting = duplexPrinting; 33 | //file.DuplexPrintingDialogMessage = "Your custom dialog message for duplex printing"; 34 | 35 | ClientPrintJob cpj = new ClientPrintJob(); 36 | cpj.PrintFile = file; 37 | if (printerName == "null") 38 | cpj.ClientPrinter = new DefaultPrinter(); 39 | else 40 | { 41 | cpj.ClientPrinter = new InstalledPrinter(printerName); 42 | } 43 | 44 | context.Response.ContentType = "application/octet-stream"; 45 | context.Response.BinaryWrite(cpj.GetContent()); 46 | context.Response.End(); 47 | 48 | } 49 | 50 | } 51 | 52 | public bool IsReusable { 53 | get { 54 | return false; 55 | } 56 | } 57 | 58 | } -------------------------------------------------------------------------------- /WCPWebFormsCS/DemoPrintFilePDFHandler.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" Class="DemoPrintFilePDFHandler" %> 2 | 3 | using System; 4 | using System.Web; 5 | 6 | using Neodynamic.SDK.Web; 7 | 8 | public class DemoPrintFilePDFHandler : IHttpHandler { 9 | 10 | /*############### IMPORTANT!!! ############ 11 | If your website requires AUTHENTICATION, then you MUST configure THIS Handler file 12 | to be ANONYMOUS access allowed!!! 13 | ######################################### */ 14 | 15 | public void ProcessRequest (HttpContext context) { 16 | 17 | if (WebClientPrint.ProcessPrintJob(context.Request.Url.Query)) 18 | { 19 | 20 | string printerName = context.Server.UrlDecode(context.Request["printerName"]); 21 | string trayName = context.Server.UrlDecode(context.Request["trayName"]); 22 | string paperName = context.Server.UrlDecode(context.Request["paperName"]); 23 | 24 | string printRotation = context.Server.UrlDecode(context.Request["printRotation"]); 25 | string pagesRange = context.Server.UrlDecode(context.Request["pagesRange"]); 26 | 27 | bool printAnnotations = (context.Request["printAnnotations"] == "true"); 28 | bool printAsGrayscale = (context.Request["printAsGrayscale"] == "true"); 29 | bool printInReverseOrder = (context.Request["printInReverseOrder"] == "true"); 30 | bool manualDuplexPrinting = (context.Request["manualDuplexPrinting"] == "true"); 31 | bool driverDuplexPrinting = (context.Request["driverDuplexPrinting"] == "true"); 32 | 33 | if (manualDuplexPrinting && driverDuplexPrinting) 34 | { 35 | manualDuplexPrinting = false; 36 | } 37 | 38 | string pageSizing = context.Server.UrlDecode(context.Request["pageSizing"]); 39 | bool autoRotate = (context.Request["autoRotate"] == "true"); 40 | bool autoCenter = (context.Request["autoCenter"] == "true"); 41 | 42 | string fileName = Guid.NewGuid().ToString("N"); 43 | string filePath = "~/files/mixed-page-orientation.pdf"; 44 | 45 | PrintFilePDF file = new PrintFilePDF(context.Server.MapPath(filePath), fileName); 46 | file.PrintRotation = (PrintRotation)Enum.Parse(typeof(PrintRotation), printRotation); 47 | file.PagesRange = pagesRange; 48 | file.PrintAnnotations = printAnnotations; 49 | file.PrintAsGrayscale = printAsGrayscale; 50 | file.PrintInReverseOrder = printInReverseOrder; 51 | if (manualDuplexPrinting) 52 | { 53 | file.DuplexPrinting = manualDuplexPrinting; 54 | //file.DuplexPrintingDialogMessage = "Your custom dialog message for duplex printing"; 55 | } 56 | file.Sizing = (Sizing)Enum.Parse(typeof(Sizing), pageSizing); 57 | file.AutoCenter = autoCenter; 58 | file.AutoRotate = autoRotate; 59 | 60 | ClientPrintJob cpj = new ClientPrintJob(); 61 | cpj.PrintFile = file; 62 | if (printerName == "null") 63 | cpj.ClientPrinter = new DefaultPrinter(); 64 | else 65 | { 66 | if (trayName == "null") trayName = ""; 67 | if (paperName == "null") paperName = ""; 68 | 69 | cpj.ClientPrinter = new InstalledPrinter(printerName, true, trayName, paperName); 70 | if (driverDuplexPrinting) 71 | ((InstalledPrinter)cpj.ClientPrinter).Duplex = Duplex.Vertical; 72 | } 73 | 74 | context.Response.ContentType = "application/octet-stream"; 75 | context.Response.BinaryWrite(cpj.GetContent()); 76 | context.Response.End(); 77 | 78 | 79 | 80 | } 81 | 82 | } 83 | 84 | public bool IsReusable { 85 | get { 86 | return false; 87 | } 88 | } 89 | 90 | } -------------------------------------------------------------------------------- /WCPWebFormsCS/DemoPrintFileXLSHandler.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="C#" Class="DemoPrintFileXLSHandler" %> 2 | 3 | using System; 4 | using System.Web; 5 | 6 | using Neodynamic.SDK.Web; 7 | 8 | public class DemoPrintFileXLSHandler : IHttpHandler { 9 | 10 | /*############### IMPORTANT!!! ############ 11 | If your website requires AUTHENTICATION, then you MUST configure THIS Handler file 12 | to be ANONYMOUS access allowed!!! 13 | ######################################### */ 14 | 15 | public void ProcessRequest (HttpContext context) { 16 | 17 | if (WebClientPrint.ProcessPrintJob(context.Request.Url.Query)) 18 | { 19 | 20 | string printerName = context.Server.UrlDecode(context.Request["printerName"]); 21 | string pagesFrom = context.Server.UrlDecode(context.Request["pagesFrom"]); 22 | string pagesTo = context.Server.UrlDecode(context.Request["pagesTo"]); 23 | 24 | string fileName = Guid.NewGuid().ToString("N"); 25 | string filePath = filePath = "~/files/Project-Scheduling-Monitoring-Tool.xls"; 26 | 27 | PrintFileXLS file = new PrintFileXLS(context.Server.MapPath(filePath), fileName); 28 | if (string.IsNullOrEmpty(pagesFrom) == false) 29 | file.PagesFrom = int.Parse(pagesFrom); 30 | if (string.IsNullOrEmpty(pagesTo) == false) 31 | file.PagesTo = int.Parse(pagesTo); 32 | 33 | ClientPrintJob cpj = new ClientPrintJob(); 34 | cpj.PrintFile = file; 35 | if (printerName == "null") 36 | cpj.ClientPrinter = new DefaultPrinter(); 37 | else 38 | { 39 | cpj.ClientPrinter = new InstalledPrinter(printerName); 40 | } 41 | 42 | context.Response.ContentType = "application/octet-stream"; 43 | context.Response.BinaryWrite(cpj.GetContent()); 44 | context.Response.End(); 45 | 46 | } 47 | 48 | } 49 | 50 | public bool IsReusable { 51 | get { 52 | return false; 53 | } 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /WCPWebFormsCS/Index.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Title="Detecting WebClientPrint Processor (WCPP)" Language="C#" MasterPageFile="~/MasterPage.master" %> 2 | 3 | 6 | 7 | 8 | 9 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 |

Detecting WCPP utility at client side...

32 |

Please wait a few seconds...

33 |
34 |
35 | 52 | 53 |
54 | 55 | 56 | 83 | 84 | <%-- WCPP detection script code --%> 85 | <%=Neodynamic.SDK.Web.WebClientPrint.CreateWcppDetectionScript(HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port + "/WebClientPrintAPI.ashx", HttpContext.Current.Session.SessionID)%> 86 | 87 | 88 | -------------------------------------------------------------------------------- /WCPWebFormsCS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WCPWebFormsCS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("WCPWebFormsCS")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9d1aa28d-5b86-4ecd-9161-b626efb391fe")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /WCPWebFormsCS/Properties/PublishProfiles/webclienttools - FTP.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | FTP 9 | AzureWebSite 10 | Release 11 | Any CPU 12 | http://webclienttools.azurewebsites.net 13 | True 14 | False 15 | ftp://waws-prod-bay-003.ftp.azurewebsites.windows.net 16 | False 17 | True 18 | site/wwwroot 19 | webclienttools\$webclienttools 20 | <_SavePWD>True 21 | 22 | -------------------------------------------------------------------------------- /WCPWebFormsCS/Properties/PublishProfiles/webclienttools - FTP.pubxml.user: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAM+IBltTbYU2hNYvj5AJoqAAAAAACAAAAAAAQZgAAAAEAACAAAABaKzxwsT+DCrGU82pJhplBsHGZ26yU0LnZgSBUsP0CXAAAAAAOgAAAAAIAACAAAACpkTISnQL2tExI6KpkStuSxsGFrPgEFXpNBY0Fm54KY4AAAACQ6bXfegGGr9SF4Ii0kP7DtUiCGbK8AuxNWWr51/3CHKRA3kz7wLbFZQh7/2mMYqJeqSI6Dlevv419/sRsl2/eOn03zqfJOChfMEaBGZsjUm42vLKgqhGuwhU2SZplf9USfar8cr998aTbZHUU9mXevAULdG1vMCbtc8VCbYFoA0AAAACj3984iUOgz1h7/jbUgYogWsAOKROQylyhXDd8kVaHcAAuyROXFjgsUfIh3QfHUFWYg2XpigRCqrbVSFUyMshs 10 | 11 | -------------------------------------------------------------------------------- /WCPWebFormsCS/Properties/PublishProfiles/webclienttools - Web Deploy.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | MSDeploy 9 | AzureWebSite 10 | Release 11 | Any CPU 12 | http://webclienttools.azurewebsites.net 13 | True 14 | False 15 | webclienttools.scm.azurewebsites.net:443 16 | webclienttools 17 | 18 | True 19 | False 20 | WMSVC 21 | True 22 | $webclienttools 23 | <_SavePWD>True 24 | <_DestinationType>AzureWebSite 25 | 26 | -------------------------------------------------------------------------------- /WCPWebFormsCS/Properties/PublishProfiles/webclienttools - Web Deploy.pubxml.user: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAM+IBltTbYU2hNYvj5AJoqAAAAAACAAAAAAAQZgAAAAEAACAAAACOiHYDFq2HXIy7Azwb9md8qNpEi0ZsS/QagdTr3UwDPgAAAAAOgAAAAAIAACAAAAAEqw8xTQnqZP39NZzi8okKoYKosKX5IRQQNa/2zbCaS4AAAACLgFwRa7vAURn9X6k1FFl2UoodsdtzaSIp6/+XuDUDHFVT+Nv+oLRbTO5iCYd7s0Z0HndjnE6a11heCoLHxPh+K5A5tu8EWLvkIrg3Y7FdRn7Lo7hYSJESR8aefYSEdryoB361B80RXvP4VEGfpHmygmRMwIxjuRFcIpCK+5HefUAAAACJG5TUyUkEoCknzX9E7bxuMaZ2GfmrgJTcfpzBfqssRUpzR73V353HB3i57xvjrXEzgz1iqQjKxFfaMM2qo05N 10 | 11 | -------------------------------------------------------------------------------- /WCPWebFormsCS/Samples.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Title="Printing Samples" Language="C#" MasterPageFile="~/MasterPage.master" %> 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 |

Available Samples

12 | 13 |
14 |
15 |
16 |

17 |  Raw Data Printing 18 |

19 |

20 | Send any raw data & commands supported by the client printer like Epson ESC/POS, HP PCL, PostScript, Zebra ZPL and Eltron EPL, and more! 21 |

22 |
23 |
24 |

25 |  Print Files 26 |

27 |

28 | Print PDF, TXT, DOC, XLS, JPG & PNG images to a client printer without displaying any Print dialog! 29 |

30 |
31 |
32 |

33 |  Printers Info 34 |

35 |

36 | Collect many useful info from all the installed printers in the client machine. 37 |

38 |
39 |
40 |
41 |
42 |

43 |  Advanced PDF Printing 44 |

45 |

46 | Print PDF files specifying advanced settings like tray, paper source, print rotation, duplex printing, pages range and more! 47 |

48 |
49 |
50 |

51 |  Advanced DOC Printing 52 |

53 |

54 | Print DOC files specifying advanced settings like duplex printing, pages range, print in reverse and more! Windows Only 55 |

56 |
57 |
58 |

59 |  Advanced XLS Printing 60 |

61 |

62 | Print XLS files specifying advanced settings like pages range (From - To) and more! Windows Only 63 |

64 |
65 |
66 |
67 |
68 |

69 |  Print Files With Encryption 70 |

71 |

72 | Encrypt and Print PDF, TXT, JPG & PNG files! 73 |

74 |
75 |
76 |

77 |  Print Files With Password Protection 78 |

79 |

80 | Print Password Protected PDF, DOC & XLS files! 81 |

82 |
83 |
84 |
85 | 86 | 87 | 88 |
89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /WCPWebFormsCS/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /WCPWebFormsCS/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /WCPWebFormsCS/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /WCPWebFormsCS/files/GuidingPrinciplesBusinessHR_EN.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/GuidingPrinciplesBusinessHR_EN.pdf -------------------------------------------------------------------------------- /WCPWebFormsCS/files/LoremIpsum-PasswordProtected.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/LoremIpsum-PasswordProtected.doc -------------------------------------------------------------------------------- /WCPWebFormsCS/files/LoremIpsum-PasswordProtected.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/LoremIpsum-PasswordProtected.pdf -------------------------------------------------------------------------------- /WCPWebFormsCS/files/LoremIpsum.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/LoremIpsum.doc -------------------------------------------------------------------------------- /WCPWebFormsCS/files/LoremIpsum.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/LoremIpsum.pdf -------------------------------------------------------------------------------- /WCPWebFormsCS/files/LoremIpsum.txt: -------------------------------------------------------------------------------- 1 | Printed By WebClientPrint 2 | ========================= 3 | 4 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce urna massa, eleifend non posuere quis, iaculis et libero. Curabitur lacinia dolor non nisl pharetra tempus. Nunc non purus eget lacus sollicitudin commodo sit amet non magna. Sed euismod massa id justo pellentesque interdum. Ut a nisi aliquam augue blandit facilisis semper eu enim. Vivamus cursus sollicitudin orci vitae elementum. Nulla ornare tortor vitae arcu suscipit eu vestibulum diam auctor. Nullam convallis sem eget velit interdum id commodo arcu condimentum. Vestibulum egestas, odio nec volutpat placerat, tellus massa rhoncus turpis, id posuere est justo ut ante. 5 | 6 | Aenean vel lacus diam. Curabitur nec ligula felis. Donec ut enim id orci aliquet tincidunt. Proin feugiat sapien at tellus viverra in porttitor magna fermentum. Sed vel sapien quis turpis semper condimentum sit amet vel tellus. Pellentesque et lorem sed lorem congue ultricies tempus nec sapien. Donec sed lectus id urna pellentesque hendrerit. Mauris pretium, justo ut varius tincidunt, purus elit tempus nibh, in ullamcorper dui est ut eros. Phasellus eget augue quis urna consequat iaculis. Aliquam ac consequat mi. Nullam lectus odio, sodales vitae dictum a, bibendum vel nisl. 7 | 8 | Nulla ut vestibulum lorem. Aliquam vel consectetur mi. Aliquam pretium dui non nunc cursus ut blandit sapien sodales. Aliquam dictum pellentesque ligula, quis mollis magna ullamcorper nec. Etiam fermentum adipiscing nibh, vitae mattis quam vestibulum non. Pellentesque volutpat lorem vel nisl luctus scelerisque. Nulla vitae mauris a orci vestibulum auctor. Phasellus vehicula dictum eros, quis porta libero cursus in. Ut sit amet tempus ante. Nulla sit amet congue libero. Aliquam erat volutpat. Phasellus lacus dolor, varius sit amet vestibulum varius, pretium nec felis. Vivamus sed vehicula magna. Praesent et mi vel magna fringilla posuere. Curabitur nunc est, scelerisque ut luctus tincidunt, blandit ac diam. 9 | 10 | Maecenas consequat consectetur nulla, id dignissim mauris volutpat ac. In mattis convallis ornare. Ut condimentum vestibulum mi id aliquam. Mauris lacinia accumsan neque vitae malesuada. Praesent dignissim diam eu mi adipiscing vehicula. Proin egestas, justo interdum convallis vehicula, elit massa eleifend arcu, tincidunt mattis neque elit ut eros. Duis neque neque, tincidunt ut venenatis eu, blandit eget massa. Aliquam sit amet ligula convallis dolor porta placerat et sed arcu. Ut suscipit urna et nisi dictum placerat. Phasellus a nisl mi. Ut ut nunc ut metus tempor iaculis sit amet eu magna. Phasellus risus eros, volutpat eu tempor sit amet, volutpat venenatis nisl. 11 | 12 | Aliquam scelerisque commodo justo, a dictum metus dapibus vel. Aenean ac volutpat velit. Proin semper euismod velit sit amet mattis. Cras ut dolor arcu. Nullam hendrerit sagittis elit vel dictum. Etiam nisl nisi, eleifend vel molestie tincidunt, porttitor ac nunc. Vestibulum vulputate magna gravida neque imperdiet ac viverra nulla suscipit. -------------------------------------------------------------------------------- /WCPWebFormsCS/files/Project-Scheduling-Monitoring-Tool.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/Project-Scheduling-Monitoring-Tool.xls -------------------------------------------------------------------------------- /WCPWebFormsCS/files/Sample-Employee-Handbook.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/Sample-Employee-Handbook.doc -------------------------------------------------------------------------------- /WCPWebFormsCS/files/SamplePngImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/SamplePngImage.png -------------------------------------------------------------------------------- /WCPWebFormsCS/files/SampleSheet-PasswordProtected.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/SampleSheet-PasswordProtected.xls -------------------------------------------------------------------------------- /WCPWebFormsCS/files/SampleSheet.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/SampleSheet.xls -------------------------------------------------------------------------------- /WCPWebFormsCS/files/mixed-page-orientation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/mixed-page-orientation.pdf -------------------------------------------------------------------------------- /WCPWebFormsCS/files/patent2pages.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/patent2pages.tif -------------------------------------------------------------------------------- /WCPWebFormsCS/files/penguins300dpi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsCS/files/penguins300dpi.jpg -------------------------------------------------------------------------------- /WCPWebFormsCS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WCPWebFormsVB/DemoPrintFileDOCHandler.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="VB" Class="DemoPrintFileDOCHandler" %> 2 | 3 | Imports System 4 | Imports System.Web 5 | 6 | Imports Neodynamic.SDK.Web 7 | 8 | Public Class DemoPrintFileDOCHandler : Implements IHttpHandler 9 | 10 | 11 | '############### IMPORTANT!!! ############ 12 | ' If your website requires AUTHENTICATION, then you MUST configure THIS Handler file 13 | ' to be ANONYMOUS access allowed!!! 14 | '######################################### 15 | 16 | 17 | Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest 18 | 19 | If WebClientPrint.ProcessPrintJob(context.Request.Url.Query) Then 20 | 21 | Dim printerName As String = context.Server.UrlDecode(context.Request("printerName")) 22 | 23 | Dim pagesRange As String = context.Server.UrlDecode(context.Request("pagesRange")) 24 | 25 | Dim printInReverseOrder As Boolean = (context.Request("printInReverseOrder") = "true") 26 | Dim duplexPrinting As Boolean = (context.Request("duplexPrinting") = "true") 27 | 28 | Dim fileName As String = Guid.NewGuid().ToString("N") 29 | Dim filePath As String = "~/files/Sample-Employee-Handbook.doc" 30 | 31 | Dim file As New PrintFileDOC(context.Server.MapPath(filePath), fileName) 32 | file.PagesRange = pagesRange 33 | file.PrintInReverseOrder = printInReverseOrder 34 | file.DuplexPrinting = duplexPrinting 35 | 'file.DuplexPrintingDialogMessage = "Your custom dialog message for duplex printing" 36 | 37 | 38 | Dim cpj As New ClientPrintJob() 39 | cpj.PrintFile = file 40 | If printerName = "null" Then 41 | cpj.ClientPrinter = New DefaultPrinter() 42 | Else 43 | cpj.ClientPrinter = New InstalledPrinter(printerName) 44 | End If 45 | 46 | context.Response.ContentType = "application/octet-stream" 47 | context.Response.BinaryWrite(cpj.GetContent()) 48 | context.Response.End() 49 | 50 | 51 | End If 52 | 53 | End Sub 54 | 55 | 56 | Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable 57 | Get 58 | Return False 59 | End Get 60 | End Property 61 | 62 | End Class -------------------------------------------------------------------------------- /WCPWebFormsVB/DemoPrintFilePDFHandler.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="VB" Class="DemoPrintFilePDFHandler" %> 2 | 3 | Imports System 4 | Imports System.Web 5 | 6 | Imports Neodynamic.SDK.Web 7 | 8 | Public Class DemoPrintFilePDFHandler : Implements IHttpHandler 9 | 10 | 11 | '############### IMPORTANT!!! ############ 12 | ' If your website requires AUTHENTICATION, then you MUST configure THIS Handler file 13 | ' to be ANONYMOUS access allowed!!! 14 | '######################################### 15 | 16 | 17 | Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest 18 | 19 | If WebClientPrint.ProcessPrintJob(context.Request.Url.Query) Then 20 | 21 | Dim printerName As String = context.Server.UrlDecode(context.Request("printerName")) 22 | Dim trayName As String = context.Server.UrlDecode(context.Request("trayName")) 23 | Dim paperName As String = context.Server.UrlDecode(context.Request("paperName")) 24 | 25 | Dim PrintRotation As String = context.Server.UrlDecode(context.Request("printRotation")) 26 | Dim pagesRange As String = context.Server.UrlDecode(context.Request("pagesRange")) 27 | 28 | Dim printAnnotations As Boolean = (context.Request("printAnnotations") = "true") 29 | Dim printAsGrayscale As Boolean = (context.Request("printAsGrayscale") = "true") 30 | Dim printInReverseOrder As Boolean = (context.Request("printInReverseOrder") = "true") 31 | Dim manualDuplexPrinting As Boolean = (context.Request("manualDuplexPrinting") = "true") 32 | Dim driverDuplexPrinting As Boolean = (context.Request("driverDuplexPrinting") = "true") 33 | 34 | If (manualDuplexPrinting AndAlso driverDuplexPrinting) Then 35 | manualDuplexPrinting = False 36 | End If 37 | 38 | Dim pageSizing As String = context.Server.UrlDecode(context.Request("pageSizing")) 39 | Dim autoRotate As Boolean = (context.Request("autoRotate") = "true") 40 | Dim autoCenter As Boolean = (context.Request("autoCenter") = "true") 41 | 42 | Dim fileName As String = Guid.NewGuid().ToString("N") 43 | Dim filePath As String = "~/files/mixed-page-orientation.pdf" 44 | 45 | Dim file As New PrintFilePDF(context.Server.MapPath(filePath), fileName) 46 | file.PrintRotation = [Enum].Parse(GetType(PrintRotation), PrintRotation) 47 | file.PagesRange = pagesRange 48 | file.PrintAnnotations = printAnnotations 49 | file.PrintAsGrayscale = printAsGrayscale 50 | file.PrintInReverseOrder = printInReverseOrder 51 | If manualDuplexPrinting Then 52 | file.DuplexPrinting = manualDuplexPrinting 53 | 'file.DuplexPrintingDialogMessage = "Your custom dialog message for duplex printing" 54 | End If 55 | file.Sizing = [Enum].Parse(GetType(Sizing), pageSizing) 56 | file.AutoCenter = autoCenter 57 | file.AutoRotate = autoRotate 58 | 59 | Dim cpj As New ClientPrintJob() 60 | cpj.PrintFile = file 61 | If printerName = "null" Then 62 | cpj.ClientPrinter = New DefaultPrinter() 63 | Else 64 | If (trayName = "null") Then trayName = "" 65 | If (paperName = "null") Then paperName = "" 66 | cpj.ClientPrinter = New InstalledPrinter(printerName, True, trayName, paperName) 67 | If driverDuplexPrinting Then 68 | DirectCast(cpj.ClientPrinter, InstalledPrinter).Duplex = Duplex.Vertical 69 | End If 70 | End If 71 | 72 | context.Response.ContentType = "application/octet-stream" 73 | context.Response.BinaryWrite(cpj.GetContent()) 74 | context.Response.End() 75 | 76 | 77 | End If 78 | 79 | End Sub 80 | 81 | 82 | Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable 83 | Get 84 | Return False 85 | End Get 86 | End Property 87 | 88 | End Class -------------------------------------------------------------------------------- /WCPWebFormsVB/DemoPrintFileXLSHandler.ashx: -------------------------------------------------------------------------------- 1 | <%@ WebHandler Language="VB" Class="DemoPrintFileXLSHandler" %> 2 | 3 | Imports System 4 | Imports System.Web 5 | 6 | Imports Neodynamic.SDK.Web 7 | 8 | Public Class DemoPrintFileXLSHandler : Implements IHttpHandler 9 | 10 | 11 | '############### IMPORTANT!!! ############ 12 | ' If your website requires AUTHENTICATION, then you MUST configure THIS Handler file 13 | ' to be ANONYMOUS access allowed!!! 14 | '######################################### 15 | 16 | 17 | Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest 18 | 19 | If WebClientPrint.ProcessPrintJob(context.Request.Url.Query) Then 20 | 21 | Dim printerName As String = context.Server.UrlDecode(context.Request("printerName")) 22 | 23 | Dim pagesFrom As String = context.Server.UrlDecode(context.Request("pagesFrom")) 24 | Dim pagesTo As String = context.Server.UrlDecode(context.Request("pagesTo")) 25 | 26 | Dim fileName As String = Guid.NewGuid().ToString("N") 27 | Dim filePath As String = "~/files/Project-Scheduling-Monitoring-Tool.xls" 28 | 29 | Dim file As New PrintFileXLS(context.Server.MapPath(filePath), fileName) 30 | If (String.IsNullOrEmpty(pagesFrom) = False) Then 31 | file.PagesFrom = Integer.Parse(pagesFrom) 32 | End If 33 | If (String.IsNullOrEmpty(pagesTo) = False) Then 34 | file.PagesTo = Integer.Parse(pagesTo) 35 | End If 36 | 37 | 38 | Dim cpj As New ClientPrintJob() 39 | cpj.PrintFile = file 40 | If printerName = "null" Then 41 | cpj.ClientPrinter = New DefaultPrinter() 42 | Else 43 | cpj.ClientPrinter = New InstalledPrinter(printerName) 44 | End If 45 | 46 | context.Response.ContentType = "application/octet-stream" 47 | context.Response.BinaryWrite(cpj.GetContent()) 48 | context.Response.End() 49 | 50 | 51 | End If 52 | 53 | End Sub 54 | 55 | 56 | Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable 57 | Get 58 | Return False 59 | End Get 60 | End Property 61 | 62 | End Class 63 | -------------------------------------------------------------------------------- /WCPWebFormsVB/Index.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Title="Detecting WebClientPrint Processor (WCPP)" Language="VB" MasterPageFile="~/MasterPage.master" %> 2 | 3 | 6 | 7 | 8 | 9 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 |
31 |

Detecting WCPP utility at client side...

32 |

Please wait a few seconds...

33 |
34 |
35 | 52 | 53 |
54 | 55 | 56 | 83 | 84 | <%-- WCPP detection script code --%> 85 | <%=Neodynamic.SDK.Web.WebClientPrint.CreateWcppDetectionScript(HttpContext.Current.Request.Url.Scheme & "://" & HttpContext.Current.Request.Url.Host & ":" & HttpContext.Current.Request.Url.Port & "/WebClientPrintAPI.ashx", HttpContext.Current.Session.SessionID)%> 86 | 87 | 88 | -------------------------------------------------------------------------------- /WCPWebFormsVB/My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' 5 | ' Changes to this file may cause incorrect behavior and will be lost if 6 | ' the code is regenerated. 7 | ' 8 | '------------------------------------------------------------------------------ 9 | 10 | Option Strict On 11 | Option Explicit On 12 | 13 | -------------------------------------------------------------------------------- /WCPWebFormsVB/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 |  2 | 3 | false 4 | false 5 | 0 6 | true 7 | 0 8 | 1 9 | true 10 | 11 | -------------------------------------------------------------------------------- /WCPWebFormsVB/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Reflection 3 | Imports System.Runtime.InteropServices 4 | 5 | ' General Information about an assembly is controlled through the following 6 | ' set of attributes. Change these attribute values to modify the information 7 | ' associated with an assembly. 8 | 9 | ' Review the values of the assembly attributes 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 'The following GUID is for the ID of the typelib if this project is exposed to COM 20 | 21 | 22 | ' Version information for an assembly consists of the following four values: 23 | ' 24 | ' Major Version 25 | ' Minor Version 26 | ' Build Number 27 | ' Revision 28 | ' 29 | ' You can specify all the values or you can default the Build and Revision Numbers 30 | ' by using the '*' as shown below: 31 | ' 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /WCPWebFormsVB/My Project/MyExtensions/MyWebExtension.vb: -------------------------------------------------------------------------------- 1 | #If _MyType <> "Empty" Then 2 | 3 | Namespace My 4 | ''' 5 | ''' Module used to define the properties that are available in the My Namespace for Web projects. 6 | ''' 7 | ''' 8 | _ 9 | Module MyWebExtension 10 | Private ReadOnly s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.ServerComputer) 11 | Private ReadOnly s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser) 12 | Private ReadOnly s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog) 13 | ''' 14 | ''' Returns information about the host computer. 15 | ''' 16 | _ 17 | Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.ServerComputer 18 | Get 19 | Return s_Computer.GetInstance() 20 | End Get 21 | End Property 22 | ''' 23 | ''' Returns information for the current Web user. 24 | ''' 25 | _ 26 | Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser 27 | Get 28 | Return s_User.GetInstance() 29 | End Get 30 | End Property 31 | ''' 32 | ''' Returns Request object. 33 | ''' 34 | _ 35 | _ 36 | Friend ReadOnly Property Request() As Global.System.Web.HttpRequest 37 | _ 38 | Get 39 | Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current 40 | If CurrentContext IsNot Nothing Then 41 | Return CurrentContext.Request 42 | End If 43 | Return Nothing 44 | End Get 45 | End Property 46 | ''' 47 | ''' Returns Response object. 48 | ''' 49 | _ 50 | _ 51 | Friend ReadOnly Property Response() As Global.System.Web.HttpResponse 52 | _ 53 | Get 54 | Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current 55 | If CurrentContext IsNot Nothing Then 56 | Return CurrentContext.Response 57 | End If 58 | Return Nothing 59 | End Get 60 | End Property 61 | ''' 62 | ''' Returns the Asp log object. 63 | ''' 64 | _ 65 | Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog 66 | Get 67 | Return s_Log.GetInstance() 68 | End Get 69 | End Property 70 | End Module 71 | End Namespace 72 | 73 | #End If -------------------------------------------------------------------------------- /WCPWebFormsVB/My Project/Resources.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' 5 | ' Changes to this file may cause incorrect behavior and will be lost if 6 | ' the code is regenerated. 7 | ' 8 | '------------------------------------------------------------------------------ 9 | 10 | Option Strict On 11 | Option Explicit On 12 | 13 | 14 | Namespace My.Resources 15 | 16 | 'This class was auto-generated by the StronglyTypedResourceBuilder 17 | 'class via a tool like ResGen or Visual Studio. 18 | 'To add or remove a member, edit your .ResX file then rerun ResGen 19 | 'with the /str option, or rebuild your VS project. 20 | ' 21 | ' A strongly-typed resource class, for looking up localized strings, etc. 22 | ' 23 | _ 27 | Friend Module Resources 28 | 29 | Private resourceMan As Global.System.Resources.ResourceManager 30 | 31 | Private resourceCulture As Global.System.Globalization.CultureInfo 32 | 33 | ' 34 | ' Returns the cached ResourceManager instance used by this class. 35 | ' 36 | _ 37 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager 38 | Get 39 | If Object.ReferenceEquals(resourceMan, Nothing) Then 40 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WCPWebFormsVB.Resources", GetType(Resources).Assembly) 41 | resourceMan = temp 42 | End If 43 | Return resourceMan 44 | End Get 45 | End Property 46 | 47 | ' 48 | ' Overrides the current thread's CurrentUICulture property for all 49 | ' resource lookups using this strongly typed resource class. 50 | ' 51 | _ 52 | Friend Property Culture() As Global.System.Globalization.CultureInfo 53 | Get 54 | Return resourceCulture 55 | End Get 56 | Set(ByVal value As Global.System.Globalization.CultureInfo) 57 | resourceCulture = value 58 | End Set 59 | End Property 60 | End Module 61 | End Namespace 62 | -------------------------------------------------------------------------------- /WCPWebFormsVB/My Project/Settings.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' 5 | ' Changes to this file may cause incorrect behavior and will be lost if 6 | ' the code is regenerated. 7 | ' 8 | '------------------------------------------------------------------------------ 9 | 10 | Option Strict On 11 | Option Explicit On 12 | 13 | 14 | Namespace My 15 | 16 | _ 19 | Partial Friend NotInheritable Class MySettings 20 | Inherits Global.System.Configuration.ApplicationSettingsBase 21 | 22 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) 23 | 24 | #Region "My.Settings Auto-Save Functionality" 25 | #If _MyType = "WindowsForms" Then 26 | Private Shared addedHandler As Boolean 27 | 28 | Private Shared addedHandlerLockObject As New Object 29 | 30 | _ 31 | Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) 32 | If My.Application.SaveMySettingsOnExit Then 33 | My.Settings.Save() 34 | End If 35 | End Sub 36 | #End If 37 | #End Region 38 | 39 | Public Shared ReadOnly Property [Default]() As MySettings 40 | Get 41 | 42 | #If _MyType = "WindowsForms" Then 43 | If Not addedHandler Then 44 | SyncLock addedHandlerLockObject 45 | If Not addedHandler Then 46 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings 47 | addedHandler = True 48 | End If 49 | End SyncLock 50 | End If 51 | #End If 52 | Return defaultInstance 53 | End Get 54 | End Property 55 | End Class 56 | End Namespace 57 | 58 | Namespace My 59 | 60 | _ 63 | Friend Module MySettingsProperty 64 | 65 | _ 66 | Friend ReadOnly Property Settings() As Global.WCPWebFormsVB.My.MySettings 67 | Get 68 | Return Global.WCPWebFormsVB.My.MySettings.Default 69 | End Get 70 | End Property 71 | End Module 72 | End Namespace -------------------------------------------------------------------------------- /WCPWebFormsVB/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WCPWebFormsVB/Samples.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Title="Printing Samples" Language="VB" MasterPageFile="~/MasterPage.master" %> 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 |

Available Samples

12 | 13 |
14 |
15 |
16 |

17 |  Raw Data Printing 18 |

19 |

20 | Send any raw data & commands supported by the client printer like Epson ESC/POS, HP PCL, PostScript, Zebra ZPL and Eltron EPL, and more! 21 |

22 |
23 |
24 |

25 |  Print Files 26 |

27 |

28 | Print PDF, TXT, DOC, XLS, JPG & PNG images to a client printer without displaying any Print dialog! 29 |

30 |
31 |
32 |

33 |  Printers Info 34 |

35 |

36 | Collect many useful info from all the installed printers in the client machine. 37 |

38 |
39 |
40 |
41 |
42 |

43 |  Advanced PDF Printing 44 |

45 |

46 | Print PDF files specifying advanced settings like tray, paper source, print rotation, duplex printing, pages range and more! 47 |

48 |
49 |
50 |

51 |  Advanced DOC Printing 52 |

53 |

54 | Print DOC files specifying advanced settings like duplex printing, pages range, print in reverse and more! Windows Only 55 |

56 |
57 |
58 |

59 |  Advanced XLS Printing 60 |

61 |

62 | Print XLS files specifying advanced settings like pages range (From - To) and more! Windows Only 63 |

64 |
65 |
66 |
67 |
68 |

69 |  Print Files With Encryption 70 |

71 |

72 | Encrypt and Print PDF, TXT, JPG & PNG files! 73 |

74 |
75 |
76 |

77 |  Print Files With Password Protection 78 |

79 |

80 | Print Password Protected PDF, DOC & XLS files! 81 |

82 |
83 |
84 |
85 | 86 | 87 |
88 | 89 | 90 | -------------------------------------------------------------------------------- /WCPWebFormsVB/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /WCPWebFormsVB/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /WCPWebFormsVB/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /WCPWebFormsVB/files/GuidingPrinciplesBusinessHR_EN.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/GuidingPrinciplesBusinessHR_EN.pdf -------------------------------------------------------------------------------- /WCPWebFormsVB/files/LoremIpsum-PasswordProtected.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/LoremIpsum-PasswordProtected.doc -------------------------------------------------------------------------------- /WCPWebFormsVB/files/LoremIpsum-PasswordProtected.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/LoremIpsum-PasswordProtected.pdf -------------------------------------------------------------------------------- /WCPWebFormsVB/files/LoremIpsum.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/LoremIpsum.doc -------------------------------------------------------------------------------- /WCPWebFormsVB/files/LoremIpsum.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/LoremIpsum.pdf -------------------------------------------------------------------------------- /WCPWebFormsVB/files/LoremIpsum.txt: -------------------------------------------------------------------------------- 1 | Printed By WebClientPrint 2 | ========================= 3 | 4 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce urna massa, eleifend non posuere quis, iaculis et libero. Curabitur lacinia dolor non nisl pharetra tempus. Nunc non purus eget lacus sollicitudin commodo sit amet non magna. Sed euismod massa id justo pellentesque interdum. Ut a nisi aliquam augue blandit facilisis semper eu enim. Vivamus cursus sollicitudin orci vitae elementum. Nulla ornare tortor vitae arcu suscipit eu vestibulum diam auctor. Nullam convallis sem eget velit interdum id commodo arcu condimentum. Vestibulum egestas, odio nec volutpat placerat, tellus massa rhoncus turpis, id posuere est justo ut ante. 5 | 6 | Aenean vel lacus diam. Curabitur nec ligula felis. Donec ut enim id orci aliquet tincidunt. Proin feugiat sapien at tellus viverra in porttitor magna fermentum. Sed vel sapien quis turpis semper condimentum sit amet vel tellus. Pellentesque et lorem sed lorem congue ultricies tempus nec sapien. Donec sed lectus id urna pellentesque hendrerit. Mauris pretium, justo ut varius tincidunt, purus elit tempus nibh, in ullamcorper dui est ut eros. Phasellus eget augue quis urna consequat iaculis. Aliquam ac consequat mi. Nullam lectus odio, sodales vitae dictum a, bibendum vel nisl. 7 | 8 | Nulla ut vestibulum lorem. Aliquam vel consectetur mi. Aliquam pretium dui non nunc cursus ut blandit sapien sodales. Aliquam dictum pellentesque ligula, quis mollis magna ullamcorper nec. Etiam fermentum adipiscing nibh, vitae mattis quam vestibulum non. Pellentesque volutpat lorem vel nisl luctus scelerisque. Nulla vitae mauris a orci vestibulum auctor. Phasellus vehicula dictum eros, quis porta libero cursus in. Ut sit amet tempus ante. Nulla sit amet congue libero. Aliquam erat volutpat. Phasellus lacus dolor, varius sit amet vestibulum varius, pretium nec felis. Vivamus sed vehicula magna. Praesent et mi vel magna fringilla posuere. Curabitur nunc est, scelerisque ut luctus tincidunt, blandit ac diam. 9 | 10 | Maecenas consequat consectetur nulla, id dignissim mauris volutpat ac. In mattis convallis ornare. Ut condimentum vestibulum mi id aliquam. Mauris lacinia accumsan neque vitae malesuada. Praesent dignissim diam eu mi adipiscing vehicula. Proin egestas, justo interdum convallis vehicula, elit massa eleifend arcu, tincidunt mattis neque elit ut eros. Duis neque neque, tincidunt ut venenatis eu, blandit eget massa. Aliquam sit amet ligula convallis dolor porta placerat et sed arcu. Ut suscipit urna et nisi dictum placerat. Phasellus a nisl mi. Ut ut nunc ut metus tempor iaculis sit amet eu magna. Phasellus risus eros, volutpat eu tempor sit amet, volutpat venenatis nisl. 11 | 12 | Aliquam scelerisque commodo justo, a dictum metus dapibus vel. Aenean ac volutpat velit. Proin semper euismod velit sit amet mattis. Cras ut dolor arcu. Nullam hendrerit sagittis elit vel dictum. Etiam nisl nisi, eleifend vel molestie tincidunt, porttitor ac nunc. Vestibulum vulputate magna gravida neque imperdiet ac viverra nulla suscipit. -------------------------------------------------------------------------------- /WCPWebFormsVB/files/Project-Scheduling-Monitoring-Tool.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/Project-Scheduling-Monitoring-Tool.xls -------------------------------------------------------------------------------- /WCPWebFormsVB/files/Sample-Employee-Handbook.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/Sample-Employee-Handbook.doc -------------------------------------------------------------------------------- /WCPWebFormsVB/files/SamplePngImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/SamplePngImage.png -------------------------------------------------------------------------------- /WCPWebFormsVB/files/SampleSheet-PasswordProtected.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/SampleSheet-PasswordProtected.xls -------------------------------------------------------------------------------- /WCPWebFormsVB/files/SampleSheet.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/SampleSheet.xls -------------------------------------------------------------------------------- /WCPWebFormsVB/files/mixed-page-orientation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/mixed-page-orientation.pdf -------------------------------------------------------------------------------- /WCPWebFormsVB/files/patent2pages.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/patent2pages.tif -------------------------------------------------------------------------------- /WCPWebFormsVB/files/penguins300dpi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neodynamic/WebClientPrint5-Sample/c5edd6a685c5b71a6cf9ea2e6c41580f85fcdbf6/WCPWebFormsVB/files/penguins300dpi.jpg -------------------------------------------------------------------------------- /WCPWebFormsVB/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | --------------------------------------------------------------------------------