├── Installers
├── PrinterPlusPlusSetup
│ ├── Port Driver
│ │ ├── Win8
│ │ │ ├── _mfilemonUI.dll
│ │ │ ├── mfilemon.dll
│ │ │ └── mfilemonUI.dll
│ │ └── WinXp
│ │ │ ├── mfilemon.dll
│ │ │ └── mfilemonUI.dll
│ ├── Printer Driver
│ │ └── WinXp
│ │ │ ├── PRINTERPLUSPLUS.PPD
│ │ │ ├── PS5UI.DLL
│ │ │ ├── PSCRIPT.HLP
│ │ │ ├── PSCRIPT.NTF
│ │ │ └── PSCRIPT5.DLL
│ └── PrinterPlusPlusSetup.vdproj
├── PrinterPlusPlusSetupCustomAction
│ ├── AutorunHelper.cs
│ ├── Installer.Designer.cs
│ ├── Installer.cs
│ ├── LogHelper.cs
│ ├── PrinterPlusPlusSetupCustomAction.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── SpoolerHelper.cs
└── PrinterPlusPlusSetup_x64
│ ├── Port Driver
│ ├── Win7
│ │ ├── mfilemon.dll
│ │ └── mfilemonUI.dll
│ └── Win8
│ │ ├── _mfilemonUI.dll
│ │ ├── mfilemon.dll
│ │ └── mfilemonUI.dll
│ ├── Printer Driver
│ └── Win7
│ │ ├── PRINTERPLUSPLUS.PPD
│ │ ├── PS5UI.DLL
│ │ ├── PSCRIPT.HLP
│ │ ├── PSCRIPT.NTF
│ │ └── PSCRIPT5.DLL
│ └── PrinterPlusPlusSetup_x64.vdproj
├── LICENSE.txt
├── PrinterPlusPlus.sln
├── PrinterPlusPlus
├── Helpers
│ ├── ConfigHelper.cs
│ ├── CryptographyHelper.cs
│ ├── IOMonitorHelper.cs
│ ├── LicenseHelper.cs
│ ├── ProcessorHelper.cs
│ └── RegistryHelper.cs
├── PrinterPlusPlus.csproj
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── app.config
├── frmMain.Designer.cs
├── frmMain.cs
├── frmMain.resx
├── frmRegistration.Designer.cs
├── frmRegistration.cs
├── frmRegistration.resx
└── icon.ico
├── PrinterPlusPlusSDK
├── ConfigHelper.cs
├── Converters
│ ├── Ghostscript.cs
│ └── PdfToText.cs
├── Extensions.cs
├── IO.cs
├── IProcessor.cs
├── PrinterPlusPlusSDK.csproj
├── ProcessResult.cs
├── Processor.cs
├── Properties
│ └── AssemblyInfo.cs
└── Shell.cs
├── Processors
└── Tutorial
│ └── EmailWeatherInCelcius
│ ├── EmailWeatherInCelcius.csproj
│ ├── Processor.cs
│ └── Properties
│ └── AssemblyInfo.cs
└── README.md
/Installers/PrinterPlusPlusSetup/Port Driver/Win8/_mfilemonUI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup/Port Driver/Win8/_mfilemonUI.dll
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup/Port Driver/Win8/mfilemon.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup/Port Driver/Win8/mfilemon.dll
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup/Port Driver/Win8/mfilemonUI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup/Port Driver/Win8/mfilemonUI.dll
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup/Port Driver/WinXp/mfilemon.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup/Port Driver/WinXp/mfilemon.dll
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup/Port Driver/WinXp/mfilemonUI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup/Port Driver/WinXp/mfilemonUI.dll
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup/Printer Driver/WinXp/PRINTERPLUSPLUS.PPD:
--------------------------------------------------------------------------------
1 | *PPD-Adobe: "4.3"
2 | *FileVersion: "1.1"
3 | *FormatVersion: "4.3"
4 | *LanguageEncoding: ISOLatin1
5 | *LanguageVersion: English
6 | *Manufacturer: "OPX Soft Inc."
7 | *ModelName: "PrinterPlusPlus"
8 | *ShortNickName: "PrinterPlusPlus"
9 | *NickName: "PrinterPlusPlus"
10 | *PCFileName: "PRINTERPLUSPLUS.PPD"
11 | *Product: "(PrinterPlusPlus)"
12 | *Product: "(AFPL PrinterPlusPlus)"
13 | *Product: "(GNU PrinterPlusPlus)"
14 | *Product: "(GPL PrinterPlusPlus)"
15 | *PSVersion: "(3010) 815"
16 | *Copyright: "2012 OPX Soft Inc."
17 |
18 | *LanguageLevel: "3"
19 | *ColorDevice: True
20 | *DefaultColorSpace: RGB
21 | *FileSystem: True
22 | *Extensions: CMYK FileSystem Composite
23 | *TTRasterizer: Type42
24 | *FreeVM: "10000000"
25 | *PrintPSErrors: True
26 | *ContoneOnly: True
27 |
28 | *OpenUI *Resolution: PickOne
29 | *DefaultResolution: 600dpi
30 | *OrderDependency: 10 AnySetup *Resolution
31 | *Resolution 600dpi: "<< /HWResolution [600 600] >> setpagedevice"
32 | *CloseUI: *Resolution
33 |
34 | *HWMargins: 0 0 0 0
35 | *ParamCustomPageSize Width: 1 points 1 5670
36 | *ParamCustomPageSize Height: 2 points 1 5670
37 | *ParamCustomPageSize WidthOffset/Width Margin: 3 points 0 5670
38 | *ParamCustomPageSize HeightOffset/Height Margin: 4 points 0 5670
39 | *ParamCustomPageSize Orientation: 5 int 0 3
40 | *NonUIOrderDependency: 20 AnySetup *CustomPageSize
41 | *CustomPageSize True: "
42 | 5 -2 roll exch 5 2 roll
43 | 3 -2 roll exch 3 2 roll
44 | [ {}
45 | {90 rotate 0 currentpagedevice /PageSize get 0 get neg translate}
46 | {180 rotate currentpagedevice /PageSize get
47 | dup 0 get neg exch 1 get neg translate}
48 | {270 rotate currentpagedevice /PageSize get 1 get neg 0 translate}
49 | ] exch get
50 | 4 dict dup begin 6 1 roll
51 | /Install exch def
52 | 2 array astore /PageOffset exch def
53 | 2 array astore /PageSize exch def
54 | /ImagingBBox null def
55 | end setpagedevice"
56 | *End
57 | *MaxMediaWidth: "5670"
58 | *MaxMediaHeight: "5670"
59 |
60 | *LandscapeOrientation: Any
61 |
62 | *OpenUI *PageSize: PickOne
63 | *DefaultPageSize: PrinterPlusPlus
64 | *OrderDependency: 20 AnySetup *PageSize
65 | *PageSize PrinterPlusPlus: "<< /PageSize [612 5670] /ImagingBBox null >> setpagedevice"
66 | *PageSize Letter: "<< /PageSize [612 792] /ImagingBBox null >> setpagedevice"
67 | *PageSize Legal: "<< /PageSize [612 1008] /ImagingBBox null >> setpagedevice"
68 | *PageSize A4: "<< /PageSize [595 842] /ImagingBBox null >> setpagedevice"
69 |
70 | *CloseUI: *PageSize
71 |
72 | *OpenUI *PageRegion: PickOne
73 | *DefaultPageRegion: PrinterPlusPlus
74 | *OrderDependency: 20 AnySetup *PageRegion
75 | *PageRegion PrinterPlusPlus: "<< /PageSize [612 5670] /ImagingBBox null >> setpagedevice"
76 | *PageRegion Letter: "<< /PageSize [612 792] /ImagingBBox null >> setpagedevice"
77 | *PageRegion Legal: "<< /PageSize [612 1008] /ImagingBBox null >> setpagedevice"
78 | *PageRegion A4: "<< /PageSize [595 842] /ImagingBBox null >> setpagedevice"
79 | *CloseUI: *PageRegion
80 |
81 | *DefaultImageableArea: PrinterPlusPlus
82 | *ImageableArea PrinterPlusPlus: "0 0 612 5670"
83 | *ImageableArea Letter: "0 0 612 792"
84 | *ImageableArea Legal: "0 0 612 1008"
85 | *ImageableArea A4: "0 0 595 842"
86 |
87 | *DefaultPaperDimension: PrinterPlusPlus
88 | *PaperDimension PrinterPlusPlus: "612 5670"
89 | *PaperDimension Letter: "612 792"
90 | *PaperDimension Legal: "612 1008"
91 | *PaperDimension A4: "595 842"
92 |
93 |
94 | *DefaultFont: Courier
95 | *Font Courier: Standard "(1.05)" Standard ROM
96 |
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup/Printer Driver/WinXp/PS5UI.DLL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup/Printer Driver/WinXp/PS5UI.DLL
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup/Printer Driver/WinXp/PSCRIPT.HLP:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup/Printer Driver/WinXp/PSCRIPT.HLP
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup/Printer Driver/WinXp/PSCRIPT.NTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup/Printer Driver/WinXp/PSCRIPT.NTF
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup/Printer Driver/WinXp/PSCRIPT5.DLL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup/Printer Driver/WinXp/PSCRIPT5.DLL
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetupCustomAction/AutorunHelper.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using Microsoft.Win32;
20 |
21 | namespace PrinterPlusPlusSetupCustomAction
22 | {
23 | public static class AutorunHelper
24 | {
25 | public static void AddToStartup()
26 | {
27 | LogHelper.Log("Adding Printer++ to Startup");
28 | var regKey = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true);
29 | regKey.SetValue("Printer++", (string)"C:\\PrinterPlusPlus\\PrinterPlusPlus.exe -silent", RegistryValueKind.String);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetupCustomAction/Installer.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | namespace PrinterPlusPlusSetupCustomAction
20 | {
21 | partial class Installer
22 | {
23 | ///
24 | /// Required designer variable.
25 | ///
26 | private System.ComponentModel.IContainer components = null;
27 |
28 | ///
29 | /// Clean up any resources being used.
30 | ///
31 | /// true if managed resources should be disposed; otherwise, false.
32 | protected override void Dispose(bool disposing)
33 | {
34 | if (disposing && (components != null))
35 | {
36 | components.Dispose();
37 | }
38 | base.Dispose(disposing);
39 | }
40 |
41 | #region Component Designer generated code
42 |
43 | ///
44 | /// Required method for Designer support - do not modify
45 | /// the contents of this method with the code editor.
46 | ///
47 | private void InitializeComponent()
48 | {
49 | components = new System.ComponentModel.Container();
50 | }
51 |
52 | #endregion
53 | }
54 | }
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetupCustomAction/Installer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System;
20 | using System.Collections;
21 | using System.ComponentModel;
22 | using System.Configuration.Install;
23 |
24 | namespace PrinterPlusPlusSetupCustomAction
25 | {
26 | [RunInstaller(true)]
27 | public partial class Installer : System.Configuration.Install.Installer
28 | {
29 | public Installer()
30 | {
31 | InitializeComponent();
32 | }
33 |
34 | public override void Install(IDictionary stateSaver)
35 | {
36 | base.Install(stateSaver);
37 | LogHelper.Log("Install Started.");
38 | LogHelper.Log("Keys:");
39 | foreach (var key in Context.Parameters.Keys)
40 | {
41 | LogHelper.Log(string.Format("{0}: {1}", key.ToString(), Context.Parameters[key.ToString()].ToString()));
42 | }
43 | //if (Context.Parameters.ContainsKey("PRINTERNAME") && !string.IsNullOrWhiteSpace(Context.Parameters["PRINTERNAME"]) && Context.Parameters.ContainsKey("PROCESSOR") && !string.IsNullOrWhiteSpace(Context.Parameters["PROCESSOR"]))
44 | string printerName = string.Empty;
45 | if (Context.Parameters.ContainsKey("PRINTERNAME") && !string.IsNullOrWhiteSpace(Context.Parameters["PRINTERNAME"]))
46 | printerName = Context.Parameters["PRINTERNAME"].ToString();
47 | else if (Context.Parameters.ContainsKey("NAME") && !string.IsNullOrWhiteSpace(Context.Parameters["NAME"]))
48 | printerName = Context.Parameters["NAME"].ToString();
49 |
50 | if (printerName != string.Empty)
51 | //if (Context.Parameters.ContainsKey("PRINTERNAME") && !string.IsNullOrWhiteSpace(Context.Parameters["PRINTERNAME"]))
52 | {
53 | //string printerName = Context.Parameters["PRINTERNAME"].ToString();
54 | //string key = Context.Parameters["PROCESSOR"].ToString();
55 | //string serial = Context.Parameters["SERIALNUMBER"].ToString();
56 |
57 | LogHelper.Log(string.Format("PrinterName: {0}", printerName));
58 | //LogHelper.Log(string.Format("Processor: {0}", key));
59 | //LogHelper.Log(string.Format("Serial: {0}", serial));
60 | try
61 | {
62 | SpoolerHelper sh = new SpoolerHelper();
63 | SpoolerHelper.GenericResult result = sh.AddVPrinter(printerName, printerName);
64 | if (result.Success == false)
65 | {
66 | LogError(result.Method, result.Message, result.Exception);
67 | throw new InstallException(string.Format("Source: {0}\nMessage: {1}", result.Method, result.Message), result.Exception);
68 | }
69 | AutorunHelper.AddToStartup();
70 | }
71 | catch (Exception ex)
72 | {
73 | LogError("AddVPrinter", ex.Message, ex);
74 | }
75 | }
76 | else
77 | {
78 | LogHelper.Log("Incomplete Parameters.");
79 | throw new InstallException("Incomplete Parameters.");
80 | }
81 |
82 | LogHelper.Log("Install Finished.");
83 | }
84 |
85 | private static void LogError(string exceptionSource, string message, Exception innerException)
86 | {
87 | string eventMessage = string.Format("Source: {0}\nMessage: {1}\nInnerException: {2}", exceptionSource, message, innerException);
88 | LogHelper.Log(eventMessage);
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetupCustomAction/LogHelper.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System;
20 | namespace PrinterPlusPlusSetupCustomAction
21 | {
22 | public static class LogHelper
23 | {
24 | public static void Log(string msg)
25 | {
26 | var filename = "C:\\PrinterPlusPlus_Installer.txt";
27 | using (var sw = new System.IO.StreamWriter(filename, true))
28 | {
29 | sw.Write(string.Format("{0} - {1}\n", DateTime.Now, msg));
30 | sw.Flush();
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetupCustomAction/PrinterPlusPlusSetupCustomAction.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {5BD928FE-4DCC-43CF-AC54-E16572464991}
9 | Library
10 | Properties
11 | PrinterPlusPlusSetupCustomAction
12 | PrinterPlusPlusSetupCustomAction
13 | v4.0
14 | 512
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | true
26 | full
27 | false
28 | bin\Debug\
29 | DEBUG;TRACE
30 | prompt
31 | 4
32 |
33 |
34 | pdbonly
35 | true
36 | bin\Release\
37 | TRACE
38 | prompt
39 | 4
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | Component
58 |
59 |
60 | Installer.cs
61 |
62 |
63 |
64 |
65 |
66 |
73 |
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetupCustomAction/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("PrinterPlusPlusSetupCustomAction")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("PrinterPlusPlusSetupCustomAction")]
13 | [assembly: AssemblyCopyright("Copyright © 2012")]
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("6d1bb939-3d53-43ef-a9ec-4300e151272b")]
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 Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetupCustomAction/SpoolerHelper.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System;
20 | using System.ComponentModel;
21 | using System.Runtime.InteropServices;
22 | using System.ServiceProcess;
23 | using System.Text;
24 | using Microsoft.Win32;
25 |
26 | namespace PrinterPlusPlusSetupCustomAction
27 | {
28 | public class SpoolerHelper
29 | {
30 |
31 | #region PInvoke Codes
32 | #region Printer Monitor
33 | //API for Adding Print Monitors
34 | //http://msdn.microsoft.com/en-us/library/windows/desktop/dd183341(v=vs.85).aspx
35 | [DllImport("winspool.drv", SetLastError = true, CharSet = CharSet.Auto)]
36 | private static extern Int32 AddMonitor(String pName, UInt32 Level, ref MONITOR_INFO_2 pMonitors);
37 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
38 | private struct MONITOR_INFO_2
39 | {
40 | public string pName;
41 | public string pEnvironment;
42 | public string pDLLName;
43 | }
44 | #endregion
45 | #region Printer Port
46 | private const int MAX_PORTNAME_LEN = 64;
47 | private const int MAX_NETWORKNAME_LEN = 49;
48 | private const int MAX_SNMP_COMMUNITY_STR_LEN = 33;
49 | private const int MAX_QUEUENAME_LEN = 33;
50 | private const int MAX_IPADDR_STR_LEN = 16;
51 | private const int RESERVED_BYTE_ARRAY_SIZE = 540;
52 |
53 | private enum PrinterAccess
54 | {
55 | ServerAdmin = 0x01,
56 | ServerEnum = 0x02,
57 | PrinterAdmin = 0x04,
58 | PrinterUse = 0x08,
59 | JobAdmin = 0x10,
60 | JobRead = 0x20,
61 | StandardRightsRequired = 0x000f0000,
62 | PrinterAllAccess = (StandardRightsRequired | PrinterAdmin | PrinterUse)
63 | }
64 |
65 | [StructLayout(LayoutKind.Sequential)]
66 | private struct PrinterDefaults
67 | {
68 | public IntPtr pDataType;
69 | public IntPtr pDevMode;
70 | public PrinterAccess DesiredAccess;
71 | }
72 |
73 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
74 | private struct PortData
75 | {
76 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PORTNAME_LEN)]
77 | public string sztPortName;
78 | }
79 |
80 | [DllImport("winspool.drv", SetLastError = true)]
81 | private static extern bool OpenPrinter(string printerName, out IntPtr phPrinter, ref PrinterDefaults printerDefaults);
82 | [DllImport("winspool.drv", SetLastError = true)]
83 | private static extern bool ClosePrinter(IntPtr phPrinter);
84 | [DllImport("winspool.drv", SetLastError = true, CharSet = CharSet.Unicode)]
85 | private static extern bool XcvDataW(IntPtr hXcv, string pszDataName, IntPtr pInputData, UInt32 cbInputData, out IntPtr pOutputData, UInt32 cbOutputData, out UInt32 pcbOutputNeeded, out UInt32 pdwStatus);
86 |
87 | #endregion
88 | #region Printer Driver
89 | //API for Adding Printer Driver
90 | //http://msdn.microsoft.com/en-us/library/windows/desktop/dd183346(v=vs.85).aspx
91 | //http://pinvoke.net/default.aspx/winspool.DRIVER_INFO_2
92 | [DllImport("winspool.drv", SetLastError = true, CharSet = CharSet.Auto)]
93 | private static extern Int32 AddPrinterDriver(String pName, UInt32 Level, ref DRIVER_INFO_3 pDriverInfo);
94 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
95 | private struct DRIVER_INFO_3
96 | {
97 | public uint cVersion;
98 | [MarshalAs(UnmanagedType.LPTStr)]
99 | public string pName;
100 | [MarshalAs(UnmanagedType.LPTStr)]
101 | public string pEnvironment;
102 | [MarshalAs(UnmanagedType.LPTStr)]
103 | public string pDriverPath;
104 | [MarshalAs(UnmanagedType.LPTStr)]
105 | public string pDataFile;
106 | [MarshalAs(UnmanagedType.LPTStr)]
107 | public string pConfigFile;
108 | [MarshalAs(UnmanagedType.LPTStr)]
109 | public string pHelpFile;
110 | [MarshalAs(UnmanagedType.LPTStr)]
111 | public string pDependentFiles;
112 | [MarshalAs(UnmanagedType.LPTStr)]
113 | public string pMonitorName;
114 | [MarshalAs(UnmanagedType.LPTStr)]
115 | public string pDefaultDataType;
116 | }
117 | [DllImport("winspool.drv", SetLastError = true, CharSet = CharSet.Unicode)]
118 | static extern bool GetPrinterDriverDirectory(StringBuilder pName, StringBuilder pEnv, int Level, [Out] StringBuilder outPath, int bufferSize, ref int Bytes);
119 | #endregion
120 | #region Printer
121 | //API for Adding Printer
122 | //http://msdn.microsoft.com/en-us/library/windows/desktop/dd183343(v=vs.85).aspx
123 | [DllImport("winspool.drv", SetLastError = true, CharSet = CharSet.Auto)]
124 | private static extern Int32 AddPrinter(string pName, uint Level, [In] ref PRINTER_INFO_2 pPrinter);
125 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
126 | private struct PRINTER_INFO_2
127 | {
128 | public string pServerName;
129 | public string pPrinterName;
130 | public string pShareName;
131 | public string pPortName;
132 | public string pDriverName;
133 | public string pComment;
134 | public string pLocation;
135 | public IntPtr pDevMode;
136 | public string pSepFile;
137 | public string pPrintProcessor;
138 | public string pDatatype;
139 | public string pParameters;
140 | public IntPtr pSecurityDescriptor;
141 | public uint Attributes;
142 | public uint Priority;
143 | public uint DefaultPriority;
144 | public uint StartTime;
145 | public uint UntilTime;
146 | public uint Status;
147 | public uint cJobs;
148 | public uint AveragePPM;
149 | }
150 | #endregion
151 | #endregion
152 |
153 | public GenericResult AddPrinterMonitor(string monitorName)
154 | {
155 | GenericResult retVal = new GenericResult("AddPrinterMonitor");
156 | MONITOR_INFO_2 mi2 = new MONITOR_INFO_2();
157 |
158 | mi2.pName = monitorName;
159 | mi2.pEnvironment = null;
160 | mi2.pDLLName = "mfilemon.dll";
161 |
162 | try
163 | {
164 | if (AddMonitor(null, 2, ref mi2) == 0)
165 | {
166 | retVal.Exception = new Win32Exception(Marshal.GetLastWin32Error());
167 | retVal.Message = retVal.Exception.Message;
168 | }
169 | }
170 | catch (Exception ex)
171 | {
172 | retVal.Exception = ex;
173 | retVal.Message = retVal.Exception.Message;
174 | }
175 | if (string.IsNullOrWhiteSpace(retVal.Message))
176 | retVal.Success = true;
177 | return retVal;
178 | }
179 |
180 | public GenericResult AddPrinterPort(string portName, string portType)
181 | {
182 | GenericResult retVal = new GenericResult("AddPrinterPort");
183 | IntPtr printerHandle;
184 | PrinterDefaults defaults = new PrinterDefaults { DesiredAccess = PrinterAccess.ServerAdmin };
185 | try
186 | {
187 | if (!OpenPrinter(",XcvMonitor " + portType, out printerHandle, ref defaults))
188 | throw new Exception("Could not open printer for the monitor port " + portType + "!");
189 | try
190 | {
191 | PortData portData = new PortData { sztPortName = portName };
192 | uint size = (uint)Marshal.SizeOf(portData);
193 | IntPtr pointer = Marshal.AllocHGlobal((int)size);
194 | Marshal.StructureToPtr(portData, pointer, true);
195 | IntPtr outputData;
196 | UInt32 outputNeeded, status;
197 | try
198 | {
199 | if (!XcvDataW(printerHandle, "AddPort", pointer, size, out outputData, 0, out outputNeeded, out status))
200 | retVal.Message = status.ToString();
201 | }
202 | catch (Exception ex)
203 | {
204 | retVal.Exception = ex;
205 | retVal.Message = retVal.Exception.Message;
206 | }
207 | finally
208 | {
209 | Marshal.FreeHGlobal(pointer);
210 | }
211 | }
212 | catch (Exception ex)
213 | {
214 | retVal.Exception = ex;
215 | retVal.Message = retVal.Exception.Message;
216 | }
217 |
218 | finally
219 | {
220 | ClosePrinter(printerHandle);
221 | }
222 | }
223 | catch (Exception ex)
224 | {
225 | retVal.Exception = ex;
226 | retVal.Message = retVal.Exception.Message;
227 | }
228 | if (string.IsNullOrWhiteSpace(retVal.Message))
229 | retVal.Success = true;
230 | return retVal;
231 | }
232 |
233 | public GenericResult GetPrinterDirectory()
234 | {
235 | GenericResult retVal = new GenericResult("GetPrinterDirectory");
236 | StringBuilder str = new StringBuilder(1024);
237 | int i = 0;
238 | GetPrinterDriverDirectory(null, null, 1, str, 1024, ref i);
239 | try
240 | {
241 | GetPrinterDriverDirectory(null, null, 1, str, 1024, ref i);
242 | retVal.Success = true;
243 | retVal.Message = str.ToString();
244 | }
245 | catch (Exception ex)
246 | {
247 | retVal.Exception = ex;
248 | retVal.Message = retVal.Exception.Message;
249 | }
250 | return retVal;
251 | }
252 |
253 | public GenericResult AddPrinterDriver(string driverName, string driverPath, string dataPath, string configPath, string helpPath)
254 | {
255 | GenericResult retVal = new GenericResult("AddPrinterDriver");
256 | DRIVER_INFO_3 di = new DRIVER_INFO_3();
257 | di.cVersion = 3;
258 | di.pName = driverName;
259 | di.pEnvironment = null;
260 | di.pDriverPath = driverPath;
261 | di.pDataFile = dataPath;
262 | di.pConfigFile = configPath;
263 | di.pHelpFile = helpPath;
264 | di.pDependentFiles = "";
265 | di.pMonitorName = null;
266 | di.pDefaultDataType = "RAW";
267 |
268 | try
269 | {
270 | if (AddPrinterDriver(null, 3, ref di) == 0)
271 | {
272 | retVal.Exception = new Win32Exception(Marshal.GetLastWin32Error());
273 | retVal.Message = retVal.Exception.Message;
274 | }
275 | }
276 | catch (Exception ex)
277 | {
278 | retVal.Exception = ex;
279 | retVal.Message = retVal.Exception.Message;
280 | }
281 | if (string.IsNullOrWhiteSpace(retVal.Message))
282 | retVal.Success = true;
283 | return retVal;
284 | }
285 |
286 | public GenericResult AddPrinter(string printerName, string portName, string driverName)
287 | {
288 | GenericResult retVal = new GenericResult("AddPrinter");
289 | PRINTER_INFO_2 pi = new PRINTER_INFO_2();
290 |
291 | pi.pServerName = null;
292 | pi.pPrinterName = printerName;
293 | pi.pShareName = "";
294 | pi.pPortName = portName;
295 | pi.pDriverName = driverName; // "Apple Color LW 12/660 PS";
296 | pi.pComment = "PrinterPlusPlus";
297 | pi.pLocation = "";
298 | pi.pDevMode = new IntPtr(0);
299 | pi.pSepFile = "";
300 | pi.pPrintProcessor = "WinPrint";
301 | pi.pDatatype = "RAW";
302 | pi.pParameters = "";
303 | pi.pSecurityDescriptor = new IntPtr(0);
304 |
305 | try
306 | {
307 | if (AddPrinter(null, 2, ref pi) == 0)
308 | {
309 | retVal.Exception = new Win32Exception(Marshal.GetLastWin32Error());
310 | retVal.Message = retVal.Exception.Message;
311 | }
312 | }
313 | catch (Exception ex)
314 | {
315 | retVal.Exception = ex;
316 | retVal.Message = retVal.Exception.Message;
317 | }
318 | if (string.IsNullOrWhiteSpace(retVal.Message))
319 | retVal.Success = true;
320 | return retVal;
321 | }
322 |
323 | public GenericResult ConfigureVirtualPort(string monitorName, string portName, string key)
324 | {
325 | GenericResult retVal = new GenericResult("ConfigureVirtualPort");
326 | try
327 | {
328 | string appPath = @"C:\PrinterPlusPlus";
329 | string outputPath = string.Format(@"{0}\Temp", appPath);
330 | string filePattern = "%r_%c_%u_%Y%m%d_%H%n%s_%j.ps";
331 | string userCommand = string.Empty;
332 | var execPath = string.Empty;
333 |
334 | string keyName = string.Format(@"SYSTEM\CurrentControlSet\Control\Print\Monitors\{0}\{1}", monitorName, portName);
335 | Registry.LocalMachine.CreateSubKey(keyName);
336 | RegistryKey regKey = Registry.LocalMachine.OpenSubKey(keyName, true);
337 | regKey.SetValue("OutputPath", outputPath, RegistryValueKind.String);
338 | regKey.SetValue("FilePattern", filePattern, RegistryValueKind.String);
339 | regKey.SetValue("Overwrite", 0, RegistryValueKind.DWord);
340 | regKey.SetValue("UserCommand", userCommand, RegistryValueKind.String);
341 | regKey.SetValue("ExecPath", execPath, RegistryValueKind.String);
342 | regKey.SetValue("WaitTermination", 0, RegistryValueKind.DWord);
343 | regKey.SetValue("PipeData", 0, RegistryValueKind.DWord);
344 | regKey.Close();
345 | retVal.Success = true;
346 | }
347 | catch (Exception ex)
348 | {
349 | retVal.Exception = ex;
350 | retVal.Message = retVal.Exception.Message;
351 | }
352 |
353 | return retVal;
354 | }
355 |
356 | public GenericResult RestartSpoolService()
357 | {
358 | GenericResult retVal = new GenericResult("RestartSpoolService");
359 | try
360 | {
361 | ServiceController sc = new ServiceController("Spooler");
362 | if (sc.Status != ServiceControllerStatus.Stopped || sc.Status != ServiceControllerStatus.StopPending)
363 | sc.Stop();
364 | sc.WaitForStatus(ServiceControllerStatus.Stopped);
365 | sc.Start();
366 | retVal.Success = true;
367 | }
368 | catch (Exception ex)
369 | {
370 | retVal.Exception = ex;
371 | retVal.Message = retVal.Exception.Message;
372 | }
373 | return retVal;
374 | }
375 |
376 | public GenericResult AddVPrinter(string printerName, string key)
377 | {
378 | GenericResult retVal = new GenericResult("AddVPrinter");
379 | try
380 | {
381 | string monitorName = "PrinterPlusPlus";
382 | string portName = string.Format("{0}:", printerName);
383 | string driverName = "PrinterPlusPlus";
384 |
385 | string driverFileName = "PSCRIPT5.DLL";
386 | string dataFileName = "PRINTERPLUSPLUS.PPD";
387 | string configFileName = "PS5UI.DLL";
388 | string helpFileName = "PSCRIPT.HLP";
389 |
390 | string driverPath = @"C:\WINDOWS\system32\spool\drivers\w32x86\PSCRIPT5.DLL";
391 | string dataPath = @"C:\WINDOWS\system32\spool\drivers\w32x86\VPRINTER.PPD";
392 | string configPath = @"C:\WINDOWS\system32\spool\drivers\w32x86\PS5UI.DLL";
393 | string helpPath = @"C:\WINDOWS\system32\spool\drivers\w32x86\PSCRIPT.HLP";
394 |
395 | //0 - Set Printer Driver Path and Files
396 | LogHelper.Log("Setting Driver Path and Files.");
397 | GenericResult printerDriverPath = GetPrinterDirectory();
398 | if (printerDriverPath.Success == true)
399 | {
400 | driverPath = string.Format("{0}\\{1}", printerDriverPath.Message, driverFileName);
401 | dataPath = string.Format("{0}\\{1}", printerDriverPath.Message, dataFileName);
402 | configPath = string.Format("{0}\\{1}", printerDriverPath.Message, configFileName);
403 | helpPath = string.Format("{0}\\{1}", printerDriverPath.Message, helpFileName);
404 | }
405 |
406 | //1 - Add Printer Monitor
407 | LogHelper.Log("Adding Printer Monitor.");
408 | GenericResult printerMonitorResult = AddPrinterMonitor(monitorName);
409 | if (printerMonitorResult.Success == false)
410 | {
411 | if (printerMonitorResult.Message.ToLower() != "the specified print monitor has already been installed")
412 | throw printerMonitorResult.Exception;
413 | }
414 |
415 | //2 - Add Printer Port
416 | LogHelper.Log("Adding Printer Port.");
417 | GenericResult printerPortResult = AddPrinterPort(portName, monitorName);
418 | if (printerPortResult.Success == false)
419 | throw printerPortResult.Exception;
420 |
421 | //3 - Add Printer Driver
422 | LogHelper.Log("Adding Printer Driver.");
423 | GenericResult printerDriverResult = AddPrinterDriver(driverName, driverPath, dataPath, configPath, helpPath);
424 | if (printerDriverResult.Success == false)
425 | throw printerDriverResult.Exception;
426 |
427 | //4 - Add Printer
428 | LogHelper.Log("Adding Printer");
429 | GenericResult printerResult = AddPrinter(printerName, portName, driverName);
430 | if (printerResult.Success == false)
431 | throw printerResult.Exception;
432 |
433 | //5 - Configure Virtual Port
434 | LogHelper.Log("Configuring Virtual Port");
435 | GenericResult configResult = ConfigureVirtualPort(monitorName, portName, key);
436 | if (configResult.Success == false)
437 | throw configResult.Exception;
438 |
439 | //6 - Restart Spool Service
440 | LogHelper.Log("Restarting Spool Service");
441 | GenericResult restartSpoolResult = RestartSpoolService();
442 | if (restartSpoolResult.Success == false)
443 | throw restartSpoolResult.Exception;
444 |
445 | LogHelper.Log("AddVPrinter Success");
446 | retVal.Success = true;
447 | }
448 | catch (Exception ex)
449 | {
450 | retVal.Exception = ex;
451 | retVal.Message = retVal.Exception.Message;
452 | LogHelper.Log(string.Format("Exception: {0}", ex.Message));
453 | }
454 |
455 | return retVal;
456 | }
457 |
458 |
459 | public class GenericResult
460 | {
461 | public GenericResult(string method)
462 | {
463 | Success = false;
464 | Message = string.Empty;
465 | Exception = null;
466 | _method = method;
467 | }
468 | public bool Success { get; set; }
469 | public string Message { get; set; }
470 | public Exception Exception { get; set; }
471 | private string _method;
472 | public string Method
473 | {
474 | get { return _method; }
475 | }
476 | }
477 | }
478 | }
479 |
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup_x64/Port Driver/Win7/mfilemon.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup_x64/Port Driver/Win7/mfilemon.dll
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup_x64/Port Driver/Win7/mfilemonUI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup_x64/Port Driver/Win7/mfilemonUI.dll
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup_x64/Port Driver/Win8/_mfilemonUI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup_x64/Port Driver/Win8/_mfilemonUI.dll
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup_x64/Port Driver/Win8/mfilemon.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup_x64/Port Driver/Win8/mfilemon.dll
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup_x64/Port Driver/Win8/mfilemonUI.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup_x64/Port Driver/Win8/mfilemonUI.dll
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup_x64/Printer Driver/Win7/PRINTERPLUSPLUS.PPD:
--------------------------------------------------------------------------------
1 | *PPD-Adobe: "4.3"
2 | *FileVersion: "1.1"
3 | *FormatVersion: "4.3"
4 | *LanguageEncoding: ISOLatin1
5 | *LanguageVersion: English
6 | *Manufacturer: "OPX Soft Inc."
7 | *ModelName: "PrinterPlusPlus"
8 | *ShortNickName: "PrinterPlusPlus"
9 | *NickName: "PrinterPlusPlus"
10 | *PCFileName: "PRINTERPLUSPLUS.PPD"
11 | *Product: "(PrinterPlusPlus)"
12 | *Product: "(AFPL PrinterPlusPlus)"
13 | *Product: "(GNU PrinterPlusPlus)"
14 | *Product: "(GPL PrinterPlusPlus)"
15 | *PSVersion: "(3010) 815"
16 | *Copyright: "2012 OPX Soft Inc."
17 |
18 | *LanguageLevel: "3"
19 | *ColorDevice: True
20 | *DefaultColorSpace: RGB
21 | *FileSystem: True
22 | *Extensions: CMYK FileSystem Composite
23 | *TTRasterizer: Type42
24 | *FreeVM: "10000000"
25 | *PrintPSErrors: True
26 | *ContoneOnly: True
27 |
28 | *OpenUI *Resolution: PickOne
29 | *DefaultResolution: 600dpi
30 | *OrderDependency: 10 AnySetup *Resolution
31 | *Resolution 600dpi: "<< /HWResolution [600 600] >> setpagedevice"
32 | *CloseUI: *Resolution
33 |
34 | *HWMargins: 0 0 0 0
35 | *ParamCustomPageSize Width: 1 points 1 5670
36 | *ParamCustomPageSize Height: 2 points 1 5670
37 | *ParamCustomPageSize WidthOffset/Width Margin: 3 points 0 5670
38 | *ParamCustomPageSize HeightOffset/Height Margin: 4 points 0 5670
39 | *ParamCustomPageSize Orientation: 5 int 0 3
40 | *NonUIOrderDependency: 20 AnySetup *CustomPageSize
41 | *CustomPageSize True: "
42 | 5 -2 roll exch 5 2 roll
43 | 3 -2 roll exch 3 2 roll
44 | [ {}
45 | {90 rotate 0 currentpagedevice /PageSize get 0 get neg translate}
46 | {180 rotate currentpagedevice /PageSize get
47 | dup 0 get neg exch 1 get neg translate}
48 | {270 rotate currentpagedevice /PageSize get 1 get neg 0 translate}
49 | ] exch get
50 | 4 dict dup begin 6 1 roll
51 | /Install exch def
52 | 2 array astore /PageOffset exch def
53 | 2 array astore /PageSize exch def
54 | /ImagingBBox null def
55 | end setpagedevice"
56 | *End
57 | *MaxMediaWidth: "5670"
58 | *MaxMediaHeight: "5670"
59 |
60 | *LandscapeOrientation: Any
61 |
62 | *OpenUI *PageSize: PickOne
63 | *OrderDependency: 20 AnySetup *PageSize
64 | *PageSize PrinterPlusPlus: "<< /PageSize [612 5670] /ImagingBBox null >> setpagedevice"
65 | *PageSize Letter: "<< /PageSize [612 792] /ImagingBBox null >> setpagedevice"
66 | *PageSize Legal: "<< /PageSize [612 1008] /ImagingBBox null >> setpagedevice"
67 | *PageSize A4: "<< /PageSize [595 842] /ImagingBBox null >> setpagedevice"
68 | *DefaultPageSize: PrinterPlusPlus
69 | *CloseUI: *PageSize
70 |
71 | *OpenUI *PageRegion: PickOne
72 | *OrderDependency: 20 AnySetup *PageRegion
73 | *PageRegion PrinterPlusPlus: "<< /PageSize [612 5670] /ImagingBBox null >> setpagedevice"
74 | *PageRegion Letter: "<< /PageSize [612 792] /ImagingBBox null >> setpagedevice"
75 | *PageRegion Legal: "<< /PageSize [612 1008] /ImagingBBox null >> setpagedevice"
76 | *PageRegion A4: "<< /PageSize [595 842] /ImagingBBox null >> setpagedevice"
77 | *DefaultPageRegion: PrinterPlusPlus
78 | *CloseUI: *PageRegion
79 |
80 | *ImageableArea PrinterPlusPlus: "0 0 612 5670"
81 | *ImageableArea Letter: "0 0 612 792"
82 | *ImageableArea Legal: "0 0 612 1008"
83 | *ImageableArea A4: "0 0 595 842"
84 | *DefaultImageableArea: PrinterPlusPlus
85 |
86 | *PaperDimension PrinterPlusPlus: "612 5670"
87 | *PaperDimension Letter: "612 792"
88 | *PaperDimension Legal: "612 1008"
89 | *PaperDimension A4: "595 842"
90 | *DefaultPaperDimension: PrinterPlusPlus
91 |
92 | *DefaultFont: Courier
93 | *Font Courier: Standard "(1.05)" Standard ROM
94 |
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup_x64/Printer Driver/Win7/PS5UI.DLL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup_x64/Printer Driver/Win7/PS5UI.DLL
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup_x64/Printer Driver/Win7/PSCRIPT.HLP:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup_x64/Printer Driver/Win7/PSCRIPT.HLP
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup_x64/Printer Driver/Win7/PSCRIPT.NTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup_x64/Printer Driver/Win7/PSCRIPT.NTF
--------------------------------------------------------------------------------
/Installers/PrinterPlusPlusSetup_x64/Printer Driver/Win7/PSCRIPT5.DLL:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/Installers/PrinterPlusPlusSetup_x64/Printer Driver/Win7/PSCRIPT5.DLL
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 |
294 | Copyright (C)
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | , 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/PrinterPlusPlus.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrinterPlusPlus", "PrinterPlusPlus\PrinterPlusPlus.csproj", "{0CFD0AB0-CCEE-49EA-AE46-AC7718069280}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrinterPlusPlusSDK", "PrinterPlusPlusSDK\PrinterPlusPlusSDK.csproj", "{CA4547EC-4F9A-42A5-8AED-97E644C588C0}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Processors", "Processors", "{F3FD4590-5CDE-46AB-AA08-E55D9E5DD922}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Installers", "Installers", "{E8EF7251-E634-41D4-918B-1807DB2E95DE}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrinterPlusPlusSetupCustomAction", "Installers\PrinterPlusPlusSetupCustomAction\PrinterPlusPlusSetupCustomAction.csproj", "{5BD928FE-4DCC-43CF-AC54-E16572464991}"
13 | EndProject
14 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "PrinterPlusPlusSetup", "Installers\PrinterPlusPlusSetup\PrinterPlusPlusSetup.vdproj", "{FFCC2470-E02D-4435-983A-B47B07B01F1A}"
15 | EndProject
16 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "PrinterPlusPlusSetup_x64", "Installers\PrinterPlusPlusSetup_x64\PrinterPlusPlusSetup_x64.vdproj", "{5E5CA562-AE9A-42F3-B74D-41CFC194D31D}"
17 | EndProject
18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tutorial", "Tutorial", "{EB297445-3AAE-4157-A081-98E8C2882CD8}"
19 | EndProject
20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmailWeatherInCelcius", "Processors\Tutorial\EmailWeatherInCelcius\EmailWeatherInCelcius.csproj", "{C486D20E-6203-48BB-8BB4-92B00AC5FEC9}"
21 | EndProject
22 | Global
23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
24 | Debug|Any CPU = Debug|Any CPU
25 | Debug|Mixed Platforms = Debug|Mixed Platforms
26 | Debug|x86 = Debug|x86
27 | Release|Any CPU = Release|Any CPU
28 | Release|Mixed Platforms = Release|Mixed Platforms
29 | Release|x86 = Release|x86
30 | EndGlobalSection
31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
32 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Debug|Any CPU.ActiveCfg = Debug|x86
33 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Debug|Any CPU.Build.0 = Debug|x86
34 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
35 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Debug|Mixed Platforms.Build.0 = Debug|x86
36 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Debug|x86.ActiveCfg = Debug|x86
37 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Debug|x86.Build.0 = Debug|x86
38 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Release|Any CPU.ActiveCfg = Release|x86
39 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Release|Any CPU.Build.0 = Release|x86
40 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
41 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Release|Mixed Platforms.Build.0 = Release|Any CPU
42 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Release|x86.ActiveCfg = Release|x86
43 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}.Release|x86.Build.0 = Release|x86
44 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
47 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
48 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}.Debug|x86.ActiveCfg = Debug|Any CPU
49 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
50 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}.Release|Any CPU.Build.0 = Release|Any CPU
51 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
52 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}.Release|Mixed Platforms.Build.0 = Release|Any CPU
53 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}.Release|x86.ActiveCfg = Release|Any CPU
54 | {5BD928FE-4DCC-43CF-AC54-E16572464991}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55 | {5BD928FE-4DCC-43CF-AC54-E16572464991}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
56 | {5BD928FE-4DCC-43CF-AC54-E16572464991}.Debug|x86.ActiveCfg = Debug|Any CPU
57 | {5BD928FE-4DCC-43CF-AC54-E16572464991}.Release|Any CPU.ActiveCfg = Release|Any CPU
58 | {5BD928FE-4DCC-43CF-AC54-E16572464991}.Release|Any CPU.Build.0 = Release|Any CPU
59 | {5BD928FE-4DCC-43CF-AC54-E16572464991}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
60 | {5BD928FE-4DCC-43CF-AC54-E16572464991}.Release|Mixed Platforms.Build.0 = Release|Any CPU
61 | {5BD928FE-4DCC-43CF-AC54-E16572464991}.Release|x86.ActiveCfg = Release|Any CPU
62 | {FFCC2470-E02D-4435-983A-B47B07B01F1A}.Debug|Any CPU.ActiveCfg = Debug
63 | {FFCC2470-E02D-4435-983A-B47B07B01F1A}.Debug|Mixed Platforms.ActiveCfg = Debug
64 | {FFCC2470-E02D-4435-983A-B47B07B01F1A}.Debug|x86.ActiveCfg = Debug
65 | {FFCC2470-E02D-4435-983A-B47B07B01F1A}.Debug|x86.Build.0 = Debug
66 | {FFCC2470-E02D-4435-983A-B47B07B01F1A}.Release|Any CPU.ActiveCfg = Release
67 | {FFCC2470-E02D-4435-983A-B47B07B01F1A}.Release|Any CPU.Build.0 = Release
68 | {FFCC2470-E02D-4435-983A-B47B07B01F1A}.Release|Mixed Platforms.ActiveCfg = Release
69 | {FFCC2470-E02D-4435-983A-B47B07B01F1A}.Release|Mixed Platforms.Build.0 = Release
70 | {FFCC2470-E02D-4435-983A-B47B07B01F1A}.Release|x86.ActiveCfg = Release
71 | {FFCC2470-E02D-4435-983A-B47B07B01F1A}.Release|x86.Build.0 = Release
72 | {5E5CA562-AE9A-42F3-B74D-41CFC194D31D}.Debug|Any CPU.ActiveCfg = Debug
73 | {5E5CA562-AE9A-42F3-B74D-41CFC194D31D}.Debug|Mixed Platforms.ActiveCfg = Debug
74 | {5E5CA562-AE9A-42F3-B74D-41CFC194D31D}.Debug|x86.ActiveCfg = Debug
75 | {5E5CA562-AE9A-42F3-B74D-41CFC194D31D}.Debug|x86.Build.0 = Debug
76 | {5E5CA562-AE9A-42F3-B74D-41CFC194D31D}.Release|Any CPU.ActiveCfg = Release
77 | {5E5CA562-AE9A-42F3-B74D-41CFC194D31D}.Release|Any CPU.Build.0 = Release
78 | {5E5CA562-AE9A-42F3-B74D-41CFC194D31D}.Release|Mixed Platforms.ActiveCfg = Release
79 | {5E5CA562-AE9A-42F3-B74D-41CFC194D31D}.Release|Mixed Platforms.Build.0 = Release
80 | {5E5CA562-AE9A-42F3-B74D-41CFC194D31D}.Release|x86.ActiveCfg = Release
81 | {5E5CA562-AE9A-42F3-B74D-41CFC194D31D}.Release|x86.Build.0 = Release
82 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
83 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
84 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
85 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
86 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9}.Debug|x86.ActiveCfg = Debug|Any CPU
87 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
88 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9}.Release|Any CPU.Build.0 = Release|Any CPU
89 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
90 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9}.Release|Mixed Platforms.Build.0 = Release|Any CPU
91 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9}.Release|x86.ActiveCfg = Release|Any CPU
92 | EndGlobalSection
93 | GlobalSection(SolutionProperties) = preSolution
94 | HideSolutionNode = FALSE
95 | EndGlobalSection
96 | GlobalSection(NestedProjects) = preSolution
97 | {EB297445-3AAE-4157-A081-98E8C2882CD8} = {F3FD4590-5CDE-46AB-AA08-E55D9E5DD922}
98 | {5BD928FE-4DCC-43CF-AC54-E16572464991} = {E8EF7251-E634-41D4-918B-1807DB2E95DE}
99 | {FFCC2470-E02D-4435-983A-B47B07B01F1A} = {E8EF7251-E634-41D4-918B-1807DB2E95DE}
100 | {5E5CA562-AE9A-42F3-B74D-41CFC194D31D} = {E8EF7251-E634-41D4-918B-1807DB2E95DE}
101 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9} = {EB297445-3AAE-4157-A081-98E8C2882CD8}
102 | EndGlobalSection
103 | EndGlobal
104 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/Helpers/ConfigHelper.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System.Configuration;
20 | namespace PrinterPlusPlus
21 | {
22 | public static class ConfigHelper
23 | {
24 | public static string ReadSetting(string key)
25 | {
26 | return ConfigurationManager.AppSettings[key];
27 | }
28 |
29 | public static void AddSetting(string key, string value)
30 | {
31 | Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
32 | var sectionName = "appSettings";
33 | config.AppSettings.Settings.Add(key, value);
34 | config.Save(ConfigurationSaveMode.Modified);
35 | ConfigurationManager.RefreshSection(sectionName);
36 | }
37 |
38 | public static void RemoveSetting(string key)
39 | {
40 | Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
41 | var sectionName = "appSettings";
42 | config.AppSettings.Settings.Remove(key);
43 | config.Save(ConfigurationSaveMode.Modified);
44 | ConfigurationManager.RefreshSection(sectionName);
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/Helpers/CryptographyHelper.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System;
20 | using System.IO;
21 | using System.Security.Cryptography;
22 | using System.Text;
23 |
24 | namespace PrinterPlusPlus
25 | {
26 | public static class CryptographyHelper
27 | {
28 | #region Static Functions
29 |
30 | ///
31 | /// Encrypts a string
32 | ///
33 | /// Text to be encrypted
34 | /// Password to encrypt with
35 | /// Salt to encrypt with
36 | /// Can be either SHA1 or MD5
37 | /// Number of iterations to do
38 | /// Needs to be 16 ASCII characters long
39 | /// Can be 128, 192, or 256
40 | /// An encrypted string
41 | public static string Encrypt(string PlainText, string Password = "OPXSoftIncPrinter++",
42 | string Salt = "OPXSoftInc", string HashAlgorithm = "SHA1",
43 | int PasswordIterations = 2, string InitialVector = "OFRna73m*aze01xY",
44 | int KeySize = 256)
45 | {
46 | if (string.IsNullOrEmpty(PlainText))
47 | return "";
48 | byte[] InitialVectorBytes = Encoding.ASCII.GetBytes(InitialVector);
49 | byte[] SaltValueBytes = Encoding.ASCII.GetBytes(Salt);
50 | byte[] PlainTextBytes = Encoding.UTF8.GetBytes(PlainText);
51 | PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations);
52 | byte[] KeyBytes = DerivedPassword.GetBytes(KeySize / 8);
53 | RijndaelManaged SymmetricKey = new RijndaelManaged();
54 | SymmetricKey.Mode = CipherMode.CBC;
55 | byte[] CipherTextBytes = null;
56 | using (ICryptoTransform Encryptor = SymmetricKey.CreateEncryptor(KeyBytes, InitialVectorBytes))
57 | {
58 | using (MemoryStream MemStream = new MemoryStream())
59 | {
60 | using (CryptoStream CryptoStream = new CryptoStream(MemStream, Encryptor, CryptoStreamMode.Write))
61 | {
62 | CryptoStream.Write(PlainTextBytes, 0, PlainTextBytes.Length);
63 | CryptoStream.FlushFinalBlock();
64 | CipherTextBytes = MemStream.ToArray();
65 | MemStream.Close();
66 | CryptoStream.Close();
67 | }
68 | }
69 | }
70 | SymmetricKey.Clear();
71 | return Convert.ToBase64String(CipherTextBytes);
72 | }
73 |
74 | ///
75 | /// Decrypts a string
76 | ///
77 | /// Text to be decrypted
78 | /// Password to decrypt with
79 | /// Salt to decrypt with
80 | /// Can be either SHA1 or MD5
81 | /// Number of iterations to do
82 | /// Needs to be 16 ASCII characters long
83 | /// Can be 128, 192, or 256
84 | /// A decrypted string
85 | public static string Decrypt(string CipherText, string Password = "OPXSoftIncPrinter++",
86 | string Salt = "OPXSoftInc", string HashAlgorithm = "SHA1",
87 | int PasswordIterations = 2, string InitialVector = "OFRna73m*aze01xY",
88 | int KeySize = 256)
89 | {
90 | if (string.IsNullOrEmpty(CipherText))
91 | return "";
92 | byte[] InitialVectorBytes = Encoding.ASCII.GetBytes(InitialVector);
93 | byte[] SaltValueBytes = Encoding.ASCII.GetBytes(Salt);
94 | byte[] CipherTextBytes = Convert.FromBase64String(CipherText);
95 | PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations);
96 | byte[] KeyBytes = DerivedPassword.GetBytes(KeySize / 8);
97 | RijndaelManaged SymmetricKey = new RijndaelManaged();
98 | SymmetricKey.Mode = CipherMode.CBC;
99 | byte[] PlainTextBytes = new byte[CipherTextBytes.Length];
100 | int ByteCount = 0;
101 | using (ICryptoTransform Decryptor = SymmetricKey.CreateDecryptor(KeyBytes, InitialVectorBytes))
102 | {
103 | using (MemoryStream MemStream = new MemoryStream(CipherTextBytes))
104 | {
105 | using (CryptoStream CryptoStream = new CryptoStream(MemStream, Decryptor, CryptoStreamMode.Read))
106 | {
107 |
108 | ByteCount = CryptoStream.Read(PlainTextBytes, 0, PlainTextBytes.Length);
109 | MemStream.Close();
110 | CryptoStream.Close();
111 | }
112 | }
113 | }
114 | SymmetricKey.Clear();
115 | return Encoding.UTF8.GetString(PlainTextBytes, 0, ByteCount);
116 | }
117 |
118 | #endregion
119 | }
120 | }
--------------------------------------------------------------------------------
/PrinterPlusPlus/Helpers/IOMonitorHelper.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System;
20 | using System.IO;
21 | using System.Security.Permissions;
22 | using PrinterPlusPlusSDK;
23 |
24 | namespace PrinterPlusPlus
25 | {
26 | [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
27 | public class IOMonitorHelper
28 | {
29 | private FileSystemWatcher fsw = null;
30 |
31 | public void StartMonitor(string path)
32 | {
33 | if (System.IO.Directory.Exists(path))
34 | {
35 | fsw = new FileSystemWatcher(path, "*.ps");
36 | fsw.NotifyFilter = System.IO.NotifyFilters.DirectoryName;
37 |
38 | fsw.NotifyFilter = fsw.NotifyFilter | System.IO.NotifyFilters.FileName;
39 | fsw.NotifyFilter = fsw.NotifyFilter | System.IO.NotifyFilters.Attributes;
40 |
41 | fsw.Created += new FileSystemEventHandler(fsw_eventHandler);
42 | //fsw.Changed += new FileSystemEventHandler(fsw_eventHandler);
43 | //fsw.Deleted += new FileSystemEventHandler(fsw_eventHandler);
44 | //fsw.Renamed += new RenamedEventHandler(fsw_eventHandler);
45 |
46 | try
47 | {
48 | fsw.EnableRaisingEvents = true;
49 | }
50 | catch (ArgumentException ex)
51 | {
52 | IO.Log(ex.Message);
53 | throw;
54 | }
55 | }
56 | else
57 | {
58 | IO.Log(string.Format("Unable to monitor folder: {0}. Folder does not exist.", path));
59 | }
60 | }
61 |
62 | public void StopMonitor()
63 | {
64 | if (fsw != null)
65 | {
66 | fsw.EnableRaisingEvents = false;
67 | fsw.Dispose();
68 | }
69 | }
70 |
71 | private void fsw_eventHandler(object sender, System.IO.FileSystemEventArgs e)
72 | {
73 | var sleepTimeout = 100;
74 | switch (e.ChangeType)
75 | {
76 | case WatcherChangeTypes.Created:
77 | while (IO.IsFileLocked(e.FullPath) == true)
78 | {
79 | IO.Log("Locked...Sleeping...");
80 | System.Threading.Thread.Sleep(sleepTimeout);
81 | }
82 | IO.Log(string.Format("Created: {0}", e.FullPath));
83 | ProcessorHelper.Process(e.FullPath);
84 | break;
85 | //case WatcherChangeTypes.Changed:
86 | // IO.Log(string.Format("Changed: {0}", e.FullPath));
87 | // break;
88 | //case WatcherChangeTypes.Deleted:
89 | // IO.Log(string.Format("Deleted: {0}", e.FullPath));
90 | // break;
91 | //case WatcherChangeTypes.Renamed:
92 | // IO.Log(string.Format("Renamed: {0}", e.FullPath));
93 | // break;
94 | default: // Another action
95 | break;
96 | }
97 | }
98 |
99 |
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/Helpers/LicenseHelper.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System;
20 | namespace PrinterPlusPlus
21 | {
22 | public static class LicenseHelper
23 | {
24 | public static string GetKey()
25 | {
26 | //return CryptographyHelper.Encrypt(GetMachineGuid());
27 | return GetKey(GetMachineGuid());
28 | }
29 |
30 | public static string GetKey(string machineId)
31 | {
32 | return CryptographyHelper.Encrypt(machineId);
33 | }
34 |
35 | public static string CleanRegKey(string value)
36 | {
37 | return value;
38 | }
39 |
40 | public static bool Register(string regKeyInput)
41 | {
42 | var retVal = false;
43 | var regKey = GetKey();
44 | if (regKey.Equals(regKeyInput, StringComparison.OrdinalIgnoreCase))
45 | {
46 | ConfigHelper.AddSetting("RegKey", regKey);
47 | retVal = true;
48 | }
49 | return retVal;
50 | }
51 |
52 | public static bool Validate()
53 | {
54 | //var regKey = ConfigHelper.ReadSetting("RegKey");
55 | //var regKeyCalculated = CryptographyHelper.Encrypt(GetMachineGuid());
56 | //var retVal = false;
57 | //if (!string.IsNullOrWhiteSpace(regKey))
58 | // retVal = (regKey.Equals(regKeyCalculated, StringComparison.OrdinalIgnoreCase));
59 | //return retVal;
60 | return true;
61 | }
62 |
63 | public static string GetMachineGuid()
64 | {
65 | var retVal = string.Empty;
66 | string regPath = @"SOFTWARE\Microsoft\Cryptography";
67 | string regKey = "MachineGuid";
68 | string value32 = RegistryHelper.ReadRegistry32(regPath, regKey);
69 | string value64 = RegistryHelper.ReadRegistry64(regPath, regKey);
70 |
71 | if (!string.IsNullOrWhiteSpace(value32))
72 | retVal = value32;
73 | else if (!string.IsNullOrWhiteSpace(value64))
74 | retVal = value64;
75 |
76 | return retVal;
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/Helpers/ProcessorHelper.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System;
20 | using System.Configuration;
21 | using System.Windows.Forms;
22 | using PrinterPlusPlusSDK;
23 |
24 | namespace PrinterPlusPlus
25 | {
26 | public class ProcessorHelper
27 | {
28 | public static void Process(string psFilename)
29 | {
30 | //%r_%c_%u_%Y%m%d_%H%n%s_%j.ps (Elfa_PH-D-W7-1_rsaturnino_20120622_131716_20.ps)
31 | //%r = Printer name
32 | //%c = ComputerName
33 | //%u = UserName
34 | //%Y%m%d = Date(YYYYMMDD)
35 | //%H%n%s = Time (HHMMSS) (24hours format)
36 | //%j = Print job id
37 | var filename = System.IO.Path.GetFileNameWithoutExtension(psFilename);
38 | var arrFileName = filename.Split('_');
39 | if (arrFileName.Length > 0)
40 | {
41 | var key = arrFileName[0];
42 | Process(key, psFilename);
43 | }
44 | }
45 |
46 | public static void Process(string key, string psFilename)
47 | {
48 | try
49 | {
50 | //Licensing.Register("639f793535871a3ebe494522bd1254af");
51 | var isRegistered = LicenseHelper.Validate();
52 | if (isRegistered == true)
53 | {
54 | IO.Log(string.Format("Process: {0}, {1}", key, psFilename));
55 | ProcessResult retVal = null;
56 | IProcessor dependencyProcessor = GetDependencyProcessor(key);
57 | if (dependencyProcessor != null)
58 | {
59 | IO.Log("Initializing Processor");
60 | Processor processor = new Processor(dependencyProcessor);
61 | IO.Log("Executing Process");
62 | retVal = processor.Process(key, psFilename);
63 | IO.Log("Process Complete");
64 | if (retVal.HasException == true)
65 | {
66 | MessageBox.Show(retVal.Exception.Message, "Printer++");
67 | IO.Log(string.Format("Exception: {0}", retVal.Exception.Message));
68 | }
69 | }
70 | else
71 | {
72 | var msg = string.Format("Processor not found for: {0}", key);
73 | MessageBox.Show(msg, "Printer++");
74 | IO.Log(msg);
75 | }
76 | }
77 | else
78 | {
79 | var frm = new frmRegistration();
80 | frm.ShowDialog();
81 | //MessageBox.Show("Printer++ is not registered.", "Printer++ Registration");
82 | }
83 | }
84 | catch (Exception ex)
85 | {
86 | IO.Log(ex.Message);
87 | }
88 | }
89 |
90 | private static IProcessor GetDependencyProcessor(string key)
91 | {
92 | //Use typeof(Processor).AssemblyQualifiedName to get the qualified name of the object and add to web.config
93 | IProcessor retVal = null;
94 | if (!string.IsNullOrWhiteSpace(key))
95 | {
96 | string classToCreate = GetProcessorQualifiedName(key);
97 | if (!string.IsNullOrWhiteSpace(classToCreate))
98 | {
99 | Type type = System.Type.GetType(classToCreate);
100 | if (type != null)
101 | {
102 | retVal = (IProcessor)Activator.CreateInstance(type);
103 | }
104 | }
105 | }
106 | return retVal;
107 | }
108 |
109 | private static string GetProcessorQualifiedName(string processor)
110 | {
111 | var retVal = string.Empty;
112 | if (!string.IsNullOrWhiteSpace(processor))
113 | {
114 | var section = (System.Collections.Specialized.NameValueCollection)ConfigurationManager.GetSection("processors");
115 | if (section != null)
116 | retVal = section[processor];
117 | }
118 | return retVal;
119 | }
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/Helpers/RegistryHelper.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using Microsoft.Win32;
20 | namespace PrinterPlusPlus
21 | {
22 | public static class RegistryHelper
23 | {
24 | public static string ReadRegistry32(string path, string key)
25 | {
26 | return ReadRegistry(path, key, RegistryView.Registry32);
27 | }
28 |
29 | public static string ReadRegistry64(string path, string key)
30 | {
31 | return ReadRegistry(path, key, RegistryView.Registry64);
32 | }
33 |
34 | public static string ReadRegistry(string path, string key, RegistryView view)
35 | {
36 | var retVal = string.Empty;
37 | RegistryKey localKey = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, view);
38 | localKey = localKey.OpenSubKey(path);
39 | if (localKey != null)
40 | {
41 | retVal = (string)localKey.GetValue(key);
42 | }
43 | return retVal;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/PrinterPlusPlus.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 | 8.0.30703
7 | 2.0
8 | {0CFD0AB0-CCEE-49EA-AE46-AC7718069280}
9 | WinExe
10 | Properties
11 | PrinterPlusPlus
12 | PrinterPlusPlus
13 | v4.0
14 |
15 |
16 | 512
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | x86
28 | true
29 | full
30 | false
31 | bin\Debug\
32 | DEBUG;TRACE
33 | prompt
34 | 4
35 |
36 |
37 | x86
38 | pdbonly
39 | true
40 | bin\Release\
41 | TRACE
42 | prompt
43 | 4
44 |
45 |
46 | icon.ico
47 |
48 |
49 | AnyCPU
50 | bin\Debug\
51 |
52 |
53 | AnyCPU
54 | bin\Release\
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | Form
74 |
75 |
76 | frmMain.cs
77 |
78 |
79 | Form
80 |
81 |
82 | frmRegistration.cs
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | frmMain.cs
92 |
93 |
94 | frmRegistration.cs
95 |
96 |
97 | ResXFileCodeGenerator
98 | Resources.Designer.cs
99 | Designer
100 |
101 |
102 | True
103 | Resources.resx
104 | True
105 |
106 |
107 |
108 | SettingsSingleFileGenerator
109 | Settings.Designer.cs
110 |
111 |
112 | True
113 | Settings.settings
114 | True
115 |
116 |
117 |
118 |
119 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}
120 | PrinterPlusPlusSDK
121 |
122 |
123 |
124 |
125 |
126 |
127 |
134 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/Program.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 |
20 | using System;
21 | using System.Windows.Forms;
22 |
23 | namespace PrinterPlusPlus
24 | {
25 | static class Program
26 | {
27 | [STAThread]
28 | static void Main(string[] args)
29 | {
30 | Application.EnableVisualStyles();
31 | Application.SetCompatibleTextRenderingDefault(false);
32 |
33 | var silentMode = false;
34 | var noMonitor = false;
35 | var key = string.Empty;
36 | var fileName = string.Empty;
37 |
38 | //-silent -nomonitor -key Elfa -file C:\PrinterPlusPlus\Temp\Elfa_PH-D-W7-1_rsaturnino_20120622_133136_22.ps
39 | for (int i = 0; i < args.Length; i++)
40 | {
41 | switch (args[i].ToLower())
42 | {
43 | case "-silent":
44 | silentMode = true;
45 | break;
46 | case "-nomonitor":
47 | noMonitor = true;
48 | break;
49 | case "-key":
50 | i += 1;
51 | key = args[i];
52 | break;
53 | case "-file":
54 | i += 1;
55 | fileName = args[i];
56 | break;
57 |
58 | default:
59 | break;
60 | }
61 | }
62 |
63 | if (LicenseHelper.Validate() == true)
64 | Application.Run(new frmMain(silentMode, noMonitor, key, fileName));
65 | else
66 | Application.Run(new frmRegistration());
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/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("PrinterPlusPlus")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("OPX Soft Inc.")]
12 | [assembly: AssemblyProduct("PrinterPlusPlus")]
13 | [assembly: AssemblyCopyright("Copyright © 2012")]
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("d64e5a9e-b09a-4d28-90ce-f75e6a225475")]
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 Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.269
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace PrinterPlusPlus.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PrinterPlusPlus.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.269
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace PrinterPlusPlus.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/frmMain.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | namespace PrinterPlusPlus
20 | {
21 | partial class frmMain
22 | {
23 | ///
24 | /// Required designer variable.
25 | ///
26 | private System.ComponentModel.IContainer components = null;
27 |
28 | ///
29 | /// Clean up any resources being used.
30 | ///
31 | /// true if managed resources should be disposed; otherwise, false.
32 | protected override void Dispose(bool disposing)
33 | {
34 | if (disposing && (components != null))
35 | {
36 | components.Dispose();
37 | }
38 | base.Dispose(disposing);
39 | }
40 |
41 | #region Windows Form Designer generated code
42 |
43 | ///
44 | /// Required method for Designer support - do not modify
45 | /// the contents of this method with the code editor.
46 | ///
47 | private void InitializeComponent()
48 | {
49 | this.components = new System.ComponentModel.Container();
50 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
51 | this.btnProcess = new System.Windows.Forms.Button();
52 | this.txtKey = new System.Windows.Forms.TextBox();
53 | this.label1 = new System.Windows.Forms.Label();
54 | this.label2 = new System.Windows.Forms.Label();
55 | this.txtFileName = new System.Windows.Forms.TextBox();
56 | this.fDialog = new System.Windows.Forms.OpenFileDialog();
57 | this.btnBrowse = new System.Windows.Forms.Button();
58 | this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
59 | this.mnuTray = new System.Windows.Forms.ContextMenuStrip(this.components);
60 | this.mnuTray_ShowHide = new System.Windows.Forms.ToolStripMenuItem();
61 | this.mnuTray_About = new System.Windows.Forms.ToolStripMenuItem();
62 | this.mnuTray_Exit = new System.Windows.Forms.ToolStripMenuItem();
63 | this.mnuTray.SuspendLayout();
64 | this.SuspendLayout();
65 | //
66 | // btnProcess
67 | //
68 | this.btnProcess.Location = new System.Drawing.Point(18, 63);
69 | this.btnProcess.Name = "btnProcess";
70 | this.btnProcess.Size = new System.Drawing.Size(384, 25);
71 | this.btnProcess.TabIndex = 0;
72 | this.btnProcess.Text = "Process";
73 | this.btnProcess.UseVisualStyleBackColor = true;
74 | this.btnProcess.Click += new System.EventHandler(this.btnProcess_Click);
75 | //
76 | // txtKey
77 | //
78 | this.txtKey.Location = new System.Drawing.Point(96, 9);
79 | this.txtKey.Name = "txtKey";
80 | this.txtKey.Size = new System.Drawing.Size(306, 22);
81 | this.txtKey.TabIndex = 1;
82 | //
83 | // label1
84 | //
85 | this.label1.AutoSize = true;
86 | this.label1.Location = new System.Drawing.Point(15, 12);
87 | this.label1.Name = "label1";
88 | this.label1.Size = new System.Drawing.Size(74, 14);
89 | this.label1.TabIndex = 2;
90 | this.label1.Text = "Processor:";
91 | //
92 | // label2
93 | //
94 | this.label2.AutoSize = true;
95 | this.label2.Location = new System.Drawing.Point(55, 39);
96 | this.label2.Name = "label2";
97 | this.label2.Size = new System.Drawing.Size(33, 14);
98 | this.label2.TabIndex = 4;
99 | this.label2.Text = "File:";
100 | //
101 | // txtFileName
102 | //
103 | this.txtFileName.Location = new System.Drawing.Point(96, 36);
104 | this.txtFileName.Name = "txtFileName";
105 | this.txtFileName.Size = new System.Drawing.Size(237, 22);
106 | this.txtFileName.TabIndex = 3;
107 | //
108 | // btnBrowse
109 | //
110 | this.btnBrowse.Location = new System.Drawing.Point(334, 36);
111 | this.btnBrowse.Name = "btnBrowse";
112 | this.btnBrowse.Size = new System.Drawing.Size(69, 22);
113 | this.btnBrowse.TabIndex = 5;
114 | this.btnBrowse.Text = "Browse";
115 | this.btnBrowse.UseVisualStyleBackColor = true;
116 | this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
117 | //
118 | // notifyIcon
119 | //
120 | this.notifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
121 | this.notifyIcon.ContextMenuStrip = this.mnuTray;
122 | this.notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon.Icon")));
123 | this.notifyIcon.Text = "Printer++";
124 | this.notifyIcon.Visible = true;
125 | this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon_MouseDoubleClick);
126 | //
127 | // mnuTray
128 | //
129 | this.mnuTray.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
130 | this.mnuTray_ShowHide,
131 | this.mnuTray_About,
132 | this.mnuTray_Exit});
133 | this.mnuTray.Name = "contextMenuStrip1";
134 | this.mnuTray.Size = new System.Drawing.Size(195, 92);
135 | //
136 | // mnuTray_ShowHide
137 | //
138 | this.mnuTray_ShowHide.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
139 | this.mnuTray_ShowHide.Name = "mnuTray_ShowHide";
140 | this.mnuTray_ShowHide.Size = new System.Drawing.Size(194, 22);
141 | this.mnuTray_ShowHide.Text = "Show/Hide Printer++";
142 | this.mnuTray_ShowHide.Click += new System.EventHandler(this.mnuTray_ShowHide_Click);
143 | //
144 | // mnuTray_About
145 | //
146 | this.mnuTray_About.Name = "mnuTray_About";
147 | this.mnuTray_About.Size = new System.Drawing.Size(194, 22);
148 | this.mnuTray_About.Text = "About";
149 | this.mnuTray_About.Visible = false;
150 | this.mnuTray_About.Click += new System.EventHandler(this.mnuTray_About_Click);
151 | //
152 | // mnuTray_Exit
153 | //
154 | this.mnuTray_Exit.Name = "mnuTray_Exit";
155 | this.mnuTray_Exit.Size = new System.Drawing.Size(194, 22);
156 | this.mnuTray_Exit.Text = "Shutdown Printer++";
157 | this.mnuTray_Exit.Click += new System.EventHandler(this.mnuTray_Exit_Click);
158 | //
159 | // frmMain
160 | //
161 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 14F);
162 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
163 | this.ClientSize = new System.Drawing.Size(418, 96);
164 | this.Controls.Add(this.btnBrowse);
165 | this.Controls.Add(this.label2);
166 | this.Controls.Add(this.txtFileName);
167 | this.Controls.Add(this.label1);
168 | this.Controls.Add(this.txtKey);
169 | this.Controls.Add(this.btnProcess);
170 | this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
171 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
172 | this.Name = "frmMain";
173 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
174 | this.Text = "Printer++";
175 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_FormClosing);
176 | this.mnuTray.ResumeLayout(false);
177 | this.ResumeLayout(false);
178 | this.PerformLayout();
179 |
180 | }
181 |
182 | #endregion
183 |
184 | private System.Windows.Forms.Button btnProcess;
185 | private System.Windows.Forms.TextBox txtKey;
186 | private System.Windows.Forms.Label label1;
187 | private System.Windows.Forms.Label label2;
188 | private System.Windows.Forms.TextBox txtFileName;
189 | private System.Windows.Forms.OpenFileDialog fDialog;
190 | private System.Windows.Forms.Button btnBrowse;
191 | private System.Windows.Forms.NotifyIcon notifyIcon;
192 | private System.Windows.Forms.ContextMenuStrip mnuTray;
193 | private System.Windows.Forms.ToolStripMenuItem mnuTray_Exit;
194 | private System.Windows.Forms.ToolStripMenuItem mnuTray_About;
195 | private System.Windows.Forms.ToolStripMenuItem mnuTray_ShowHide;
196 | }
197 | }
198 |
199 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/frmMain.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 |
20 | using System;
21 | using System.Configuration;
22 | using System.Windows.Forms;
23 | using PrinterPlusPlusSDK;
24 |
25 | namespace PrinterPlusPlus
26 | {
27 | public partial class frmMain : Form
28 | {
29 | private bool closedFromMenu = false;
30 | IOMonitorHelper iomh = null;
31 |
32 | public frmMain()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | public frmMain(bool silentMode, bool noMonitor, string key, string fileName)
38 | {
39 | try
40 | {
41 | IO.Log(string.Format("Starting Printer++: ({0},{1},{2},{3})", silentMode, noMonitor, key, fileName));
42 | InitializeComponent();
43 | iomh = new IOMonitorHelper();
44 |
45 | if (silentMode == true)
46 | {
47 | WindowState = FormWindowState.Minimized;
48 | ShowInTaskbar = false;
49 | }
50 |
51 | if (!noMonitor)
52 | iomh.StartMonitor("C:\\PrinterPlusPlus\\Temp");
53 |
54 | if (!string.IsNullOrWhiteSpace(key))
55 | txtKey.Text = key;
56 | else
57 | txtKey.Text = ConfigurationManager.AppSettings["DefaultProcessor"];
58 |
59 |
60 | if (!string.IsNullOrWhiteSpace(fileName))
61 | txtFileName.Text = fileName;
62 |
63 | Process(key, fileName);
64 | }
65 | catch (Exception ex)
66 | {
67 | ShowError(ex);
68 | }
69 | }
70 |
71 | private void btnProcess_Click(object sender, EventArgs e)
72 | {
73 | Process(txtKey.Text, txtFileName.Text);
74 | }
75 |
76 | private void btnBrowse_Click(object sender, EventArgs e)
77 | {
78 | try
79 | {
80 | if (fDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
81 | {
82 | txtFileName.Text = fDialog.FileName;
83 | }
84 | }
85 | catch (Exception ex)
86 | {
87 | ShowError(ex);
88 | }
89 | }
90 |
91 | private void Process(string key, string fileName)
92 | {
93 | try
94 | {
95 | if (!string.IsNullOrWhiteSpace(key) && !string.IsNullOrWhiteSpace(fileName))
96 | {
97 | IO.Log(string.Format("Processing: {0}. {1}", key, fileName));
98 | ProcessorHelper.Process(key, fileName);
99 | }
100 | }
101 | catch (Exception ex)
102 | {
103 | ShowError(ex);
104 | }
105 |
106 | }
107 |
108 | #region Form
109 | private void ShowError(Exception ex)
110 | {
111 | //IO.Log(ex.Message);
112 | MessageBox.Show(ex.Message, "Unhandled Exception");
113 | }
114 | private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
115 | {
116 | if (e.CloseReason == CloseReason.WindowsShutDown || e.CloseReason == CloseReason.TaskManagerClosing)
117 | closedFromMenu = true;
118 |
119 | if (closedFromMenu == false)
120 | {
121 | WindowState = FormWindowState.Minimized;
122 | ShowInTaskbar = false;
123 | e.Cancel = true;
124 | }
125 | else
126 | {
127 | if (iomh != null)
128 | iomh.StopMonitor();
129 | }
130 | }
131 | private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)
132 | {
133 | mnuTray_ShowHide_Click(sender, e);
134 | }
135 | #endregion
136 |
137 | #region mnuTray
138 | private void mnuTray_Exit_Click(object sender, EventArgs e)
139 | {
140 | closedFromMenu = true;
141 | this.Close();
142 | }
143 | private void mnuTray_About_Click(object sender, EventArgs e)
144 | {
145 |
146 | }
147 | private void mnuTray_ShowHide_Click(object sender, EventArgs e)
148 | {
149 | //this.Visible = !this.Visible;
150 | //if (!this.ShowInTaskbar)
151 | // this.ShowInTaskbar = true;
152 | this.ShowInTaskbar = !this.ShowInTaskbar;
153 |
154 | if (this.WindowState == FormWindowState.Minimized)
155 | this.WindowState = FormWindowState.Normal;
156 | else
157 | this.WindowState = FormWindowState.Minimized;
158 | }
159 | #endregion
160 |
161 | }
162 | }
163 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/frmRegistration.Designer.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | namespace PrinterPlusPlus
20 | {
21 | partial class frmRegistration
22 | {
23 | ///
24 | /// Required designer variable.
25 | ///
26 | private System.ComponentModel.IContainer components = null;
27 |
28 | ///
29 | /// Clean up any resources being used.
30 | ///
31 | /// true if managed resources should be disposed; otherwise, false.
32 | protected override void Dispose(bool disposing)
33 | {
34 | if (disposing && (components != null))
35 | {
36 | components.Dispose();
37 | }
38 | base.Dispose(disposing);
39 | }
40 |
41 | #region Windows Form Designer generated code
42 |
43 | ///
44 | /// Required method for Designer support - do not modify
45 | /// the contents of this method with the code editor.
46 | ///
47 | private void InitializeComponent()
48 | {
49 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmRegistration));
50 | this.lblProductId = new System.Windows.Forms.Label();
51 | this.txtProductId = new System.Windows.Forms.TextBox();
52 | this.lblRegistrationKey = new System.Windows.Forms.Label();
53 | this.txtRegistrationKey = new System.Windows.Forms.TextBox();
54 | this.btnRegister = new System.Windows.Forms.Button();
55 | this.SuspendLayout();
56 | //
57 | // lblProductId
58 | //
59 | this.lblProductId.AutoSize = true;
60 | this.lblProductId.Location = new System.Drawing.Point(46, 15);
61 | this.lblProductId.Name = "lblProductId";
62 | this.lblProductId.Size = new System.Drawing.Size(78, 14);
63 | this.lblProductId.TabIndex = 4;
64 | this.lblProductId.Text = "Product ID:";
65 | //
66 | // txtProductId
67 | //
68 | this.txtProductId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
69 | | System.Windows.Forms.AnchorStyles.Right)));
70 | this.txtProductId.Location = new System.Drawing.Point(130, 12);
71 | this.txtProductId.Name = "txtProductId";
72 | this.txtProductId.Size = new System.Drawing.Size(289, 22);
73 | this.txtProductId.TabIndex = 3;
74 | //
75 | // lblRegistrationKey
76 | //
77 | this.lblRegistrationKey.AutoSize = true;
78 | this.lblRegistrationKey.Location = new System.Drawing.Point(9, 43);
79 | this.lblRegistrationKey.Name = "lblRegistrationKey";
80 | this.lblRegistrationKey.Size = new System.Drawing.Size(115, 14);
81 | this.lblRegistrationKey.TabIndex = 6;
82 | this.lblRegistrationKey.Text = "Registration Key:";
83 | //
84 | // txtRegistrationKey
85 | //
86 | this.txtRegistrationKey.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
87 | | System.Windows.Forms.AnchorStyles.Left)
88 | | System.Windows.Forms.AnchorStyles.Right)));
89 | this.txtRegistrationKey.Location = new System.Drawing.Point(130, 40);
90 | this.txtRegistrationKey.Multiline = true;
91 | this.txtRegistrationKey.Name = "txtRegistrationKey";
92 | this.txtRegistrationKey.Size = new System.Drawing.Size(289, 54);
93 | this.txtRegistrationKey.TabIndex = 5;
94 | //
95 | // btnRegister
96 | //
97 | this.btnRegister.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
98 | | System.Windows.Forms.AnchorStyles.Right)));
99 | this.btnRegister.Location = new System.Drawing.Point(4, 100);
100 | this.btnRegister.Name = "btnRegister";
101 | this.btnRegister.Size = new System.Drawing.Size(415, 31);
102 | this.btnRegister.TabIndex = 7;
103 | this.btnRegister.Text = "Register";
104 | this.btnRegister.UseVisualStyleBackColor = true;
105 | this.btnRegister.Click += new System.EventHandler(this.btnRegister_Click);
106 | //
107 | // frmRegistration
108 | //
109 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 14F);
110 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
111 | this.ClientSize = new System.Drawing.Size(425, 143);
112 | this.Controls.Add(this.btnRegister);
113 | this.Controls.Add(this.lblRegistrationKey);
114 | this.Controls.Add(this.txtRegistrationKey);
115 | this.Controls.Add(this.lblProductId);
116 | this.Controls.Add(this.txtProductId);
117 | this.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
118 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
119 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
120 | this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
121 | this.MaximizeBox = false;
122 | this.MinimizeBox = false;
123 | this.Name = "frmRegistration";
124 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
125 | this.Text = "Printer++ Registration";
126 | this.Load += new System.EventHandler(this.frmRegistration_Load);
127 | this.ResumeLayout(false);
128 | this.PerformLayout();
129 |
130 | }
131 |
132 | #endregion
133 |
134 | private System.Windows.Forms.Label lblProductId;
135 | private System.Windows.Forms.TextBox txtProductId;
136 | private System.Windows.Forms.Label lblRegistrationKey;
137 | private System.Windows.Forms.TextBox txtRegistrationKey;
138 | private System.Windows.Forms.Button btnRegister;
139 | }
140 | }
--------------------------------------------------------------------------------
/PrinterPlusPlus/frmRegistration.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 |
20 | using System;
21 | using System.Windows.Forms;
22 |
23 | namespace PrinterPlusPlus
24 | {
25 | public partial class frmRegistration : Form
26 | {
27 | public frmRegistration()
28 | {
29 | InitializeComponent();
30 | }
31 |
32 | private void btnRegister_Click(object sender, EventArgs e)
33 | {
34 | if (!string.IsNullOrWhiteSpace(txtRegistrationKey.Text))
35 | {
36 | //if (txtRegistrationKey.Text == "generateNEWkeyPrinter+Plus")
37 | // txtRegistrationKey.Text = LicenseHelper.GetKey();
38 | //else
39 | //{
40 | if (LicenseHelper.Register(txtRegistrationKey.Text) == true)
41 | {
42 | MessageBox.Show("Thank you for registering Printer++.\nPlease restart the Printer++ to apply the changes.", "Printer++");
43 | //this.Hide();
44 | //var frm = new frmMain(false, false, string.Empty, string.Empty);
45 | //frm.ShowDialog();
46 | this.Close();
47 | }
48 | else
49 | MessageBox.Show("Invalid Registration Key.", "Printer++");
50 | //}
51 | }
52 | else
53 | {
54 | MessageBox.Show("Registration Key is empty.", "Printer++");
55 | }
56 | }
57 |
58 | private void frmRegistration_Load(object sender, EventArgs e)
59 | {
60 | txtProductId.Text = LicenseHelper.GetMachineGuid();
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/frmRegistration.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | True
122 |
123 |
124 |
125 |
126 | AAABAAEAQEAAAAEAIAAoQgAAFgAAACgAAABAAAAAgAAAAAEAIAAAAAAAAEAAABILAAASCwAAAAAAAAAA
127 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
128 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
129 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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v7//f7+//3+/v/9/v7//f7+//3+/v/9/v3//f79//39
193 | /f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f39//39
194 | /f/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//P39//X39v+wtrT/rbSx/8/X0//P19P/z9fT/8/X
195 | 0//z9fT/sraz/3d8eaUAAAAAAAAAAHd8eqWyt7X/9Pb1/8/X0//P19P/z9fT/8/X0//L0s//r7Wz/6mw
196 | rf+psK3/qa+s/6mvrP+or6z/qK+s/6ivrP+or6z/qK6r/6iuq/+nrqv/p66r/6euq/+nrav/p62r/6at
197 | qv+mrar/pq2q/6atqv+mrKn/pqyp/6Wsqf+lrKn/payp/6Wrqf+lq6n/pKuo/6SrqP+kq6j/pKuo/6Sq
198 | p/+kqqf/o6qn/6Oqp/+jqqf/o6mn/6Opp/+jqab/o6mm/6Kppv+iqab/oqil/6Kopf+hqKX/p7Ct/8DV
199 | 0v/A2dj/wtnX/8rY1f/P19P/9Pb1/7K3tf93fHqlAAAAAAAAAAB5fXyltLi2//X29v/P19P/z9fT/8/X
200 | 0//P19P/z9fT/87V0v/Hz8v/xMzJ/8TMyf/Ey8j/xMvI/8TLyP/Ey8j/xMvI/8TLyP/Ey8j/xMvI/8TL
201 | yP/Ey8j/xMvI/8TLyP/Ey8j/xMvI/8PLyP/Dy8j/w8vI/8PLyP/Dysf/w8rH/8PKx//Dysf/w8rH/8PK
202 | x//Dysf/w8rH/8PKx//Dysf/w8rH/8PKx//Dysf/wsrH/8LKx//Cycb/wsnG/8LJxv/Cycb/wsnG/8LJ
203 | xv/Cycb/t9HR/63d4P+s6vD/qO30/6vr8v+t4ub/uNra//H19v+0uLb/eX18pQAAAAAAAAAAeX98pbW6
204 | uP/2+Pf/0trW/9La1v/S2tb/0trW/9La1v/S2tb/0trW/9La1v/S2tb/0trW/9La1v/S2tb/0trW/9La
205 | 1v/S2tb/0trW/9La1v/S2tb/0trW/9La1v/S2tb/0trW/9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H/8PJx//Dycf/w8nH/8PJ
218 | x//Dycf/w8nH/8PJx//Dycf/w8nH/8PJx//Dycf/w8nH/8PJx//Dycf/w8nH/8PJx//Dycf/w8nH/8PJ
219 | x//Dycf/w8nH/8PJx//Dycf/w8nH/8PJx//Dycf/w8nH/8PJx//Dycf/w8nH/8PJx//Dycf/w8nH/8bM
220 | yf/N0tD/2t/d/9Xk4v/B5OX/rd/i/6Xd4P+p3OH/u+Ll/9Dl5f/6+/r/pqqp+XyBgIwAAAAAAAAAAH2C
221 | gHiZnZv5+/z7/+Xo5//g5OP/4OTj/+Dk4//g5OP/4OTj/8bNy/+2vbr/wMbE/9HV1P/V2df/1dnX/9XZ
222 | 1//V2df/1dnX/9XZ1//V2df/1dnX/9XZ1//V2df/1dnX/9XZ1//V2df/1dnX/9XZ1//V2df/1dnX/9XZ
223 | 1//V2df/1dnX/9XZ1//V2df/1dnX/9XZ1//V2df/1dnX/9XZ1//V2df/1dnX/9XZ1//V2df/1dnX/9XZ
224 | 1//V2df/1dnX/9XZ1//Q1NL/vcPB/7m/vP/U2dj/4OTj/+Dk4//e5OP/3+Tj/+Dk4//l6Oj/+/z7/5ic
225 | m/l9goB2AAAAAAAAAAB+gYFdiIuJ/Pz8/P/r7ez/5Ofm/+Tn5v/k5+b/5Ofm/9DV1P+5v73/5Ofl//7+
226 | /v//////////////////////////////////////////////////////////////////////////////
227 | ////////////////////////////////////////////////////////////////////////////////
228 | //////////////////////////////////////////////7+/v/h5OL/ub+9/+Di4v/k5+b/5Ofm/+Tn
229 | 5v/k5+b/6+3s//v8/P+FiYf9foGBXQAAAAAAAAAAfIODJ36Dgf/09fX/8vTz/+fq6f/n6un/5+rp/+fq
230 | 6f+7wb7/297d///////s7u3/4OLi/93g3//d4N//3eDf/93g3//d4N//3eDf/93g3//d4N//3eDf/93g
231 | 3//d4N//3eDf/93g3//d4N//3eDf/93g3//d4N//3eDf/93g3//d4N//3eDf/93g3//d4N//3eDf/93g
232 | 3//d4N//3eDf/93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 9v/19vb/9fb2//X29v/19vb/9fb2//X29v/19vX/9fb1//X29f/19vX/9fb1//X19f//////y87N/4qQ
284 | jaUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
285 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI2TkaXN0M////////b3
286 | 9v/19vb/9fb2//X29v/19vb/9fb2//X29v/19vb/9fb2//X29v/19vX/9fb1//Hu7P++knD/q3FF/6pv
287 | Qv+qb0L/qnFE/7yQbv/w7uz/9PX1//T19f/09fX/9PX1//T19f/09fX/9PX1//T19f/09fX/9PX0//T1
288 | 9P/09fT//////83Pzv+Nk5GlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
289 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
290 | AACQlpSlztHQ///////19fX/9fX1//X19f/19fX/9PX1//T19f/09fX/9PX1//T19f/09fX/9PX1//Hu
291 | 7P+/l3f/r3lO/652S/+tdUn/rXVJ/612Sv+td0z/vpRz/+/t6//z9PT/8/T0//P09P/z9PT/8/T0//P0
292 | 9P/z9PP/8/Tz//P08//z9PP/8/Tz///////O0ND/kJaUpQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
293 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
294 | AAAAAAAAAAAAAAAAAAAAAAAAlJmXpdDS0f//////9PX0//T19P/z9PT/8/T0//P09P/z9PT/8/T0//P0
295 | 9P/z9PT/8/T0//Du6//CnH3/sn9X/7F8U/+we1H/r3lP/695T/+welD/sHtS/7J+Vf/BmXr/7+3q//Lz
296 | 8//y8/P/8vPz//Lz8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/5+rp/+fq6f/n6ej/5+no/+fp
347 | 6P/n6ej/5+no/+fp6P/n6ej/5+no/+fp6P/n6ej/5+no/+fp6P/n6ej/5+no/+bp6P//////29/d/7jA
348 | u6UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
349 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALvDvqXd4d///////+fq
350 | 6f/n6ej/5+no/+fp6P/n6ej/5+no/+fp6P/n6ej/5+no/+fp6P/n6ej/5+no/+fp6P/n6ej/5+no/+bp
351 | 6P/m6ej/5uno/+bp6P/m6ej/5ujn/+bo5//m6Of/5ujn/+bo5//m6Of/5ujn/+bo5//m6Of/5ejn/+Xo
352 | 5//l6Of//////93h3/+7w76lAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
353 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
354 | AAC8xcGd1trY/P/////3+Pj/9/j3//f49//3+Pf/9/f3//f39//39/f/9/f3//f39//39/f/9/f3//f3
355 | 9//39/f/9vf3//b39//29/f/9vf3//b39//29/f/9vf3//b39//29/f/9vf3//b39//29/f/9vf3//b3
356 | 9//29/f/9vf3//b39//29/f/9/f3///////V2tf8vcXAmwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
357 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
358 | AAAAAAAAAAAAAAAAAAAAAAAAwcjFRsHIxP3m6Of/8vTz//L08//y9PP/8vTz//L08//y9PP/8vTz//L0
359 | 8//y9PP/8vTz//L08//y9PP/8vTz//L08//y9PP/8vTz//L08//y9PP/8vTz//L08//y9PP/8vT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AAAAAAAAAAAAAAA
397 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
398 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
399 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
400 | AAAAAAAA//////////////4AAH////wAAAAAAAA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
401 | AACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAGAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAGAAAAAAAAAAYAA
402 | AAAAAAABgAAAAAAAAAGAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAGAAAAAAAAAAYAAAAAAAAABgAAAAAAA
403 | AAGAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAHAAAAAAAAAA8AAAAAAAAADwAAAAAAAAAPgAAAAAAAAB+AA
404 | AAAAAAAH8AAAAAAAAA/4AAAAAAAAH/gAAAAAAAAf/AAAAAAAAD/+AAAAAAAAf/8AAAAAAAD///gAAAAA
405 | H///+AAAAAAf///4AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAAH///+AAAAAAf///4
406 | AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAAH///+AAAAAAf///4AAAAAB////gAAAAA
407 | H///+AAAAAAf///4AAAAAB////gAAAAAH////AAAAAA//////wAAf///////gAH////////gA///////
408 | //gf//////////////////////////////////////////////8=
409 |
410 |
411 |
--------------------------------------------------------------------------------
/PrinterPlusPlus/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yiidiir/printerplusplus/08c71cc641afd3ebe09eab8afd0921fdd8116cd7/PrinterPlusPlus/icon.ico
--------------------------------------------------------------------------------
/PrinterPlusPlusSDK/ConfigHelper.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System;
20 | using System.Xml;
21 |
22 | namespace PrinterPlusPlusSDK
23 | {
24 | public static class ConfigHelper
25 | {
26 | public static void AddProcessor(string processorName, string assemblyQualifiedName)
27 | {
28 | XmlDocument doc = loadConfigDocument();
29 | XmlNode node = doc.SelectSingleNode("//processors");
30 |
31 | if (node == null)
32 | throw new InvalidOperationException("processors section not found in config file.");
33 | try
34 | {
35 | XmlElement elem = (XmlElement)node.SelectSingleNode(string.Format("//add[@key='{0}']", processorName));
36 | if (elem != null)
37 | {
38 | elem.SetAttribute("value", assemblyQualifiedName);
39 | }
40 | else
41 | {
42 | elem = doc.CreateElement("add");
43 | elem.SetAttribute("key", processorName);
44 | elem.SetAttribute("value", assemblyQualifiedName);
45 | node.AppendChild(elem);
46 | }
47 | doc.Save(getConfigFilePath());
48 | SetDefaultProcessor(processorName);
49 | }
50 | catch
51 | {
52 | throw;
53 | }
54 | }
55 |
56 | public static void SetDefaultProcessor(string processorName)
57 | {
58 | XmlDocument doc = loadConfigDocument();
59 | XmlNode node = doc.SelectSingleNode("//appSettings");
60 | var key = "DefaultProcessor";
61 | if (node == null)
62 | throw new InvalidOperationException("appSettings section not found in config file.");
63 | try
64 | {
65 | XmlElement elem = (XmlElement)node.SelectSingleNode(string.Format("//add[@key='{0}']", key));
66 | if (elem != null)
67 | {
68 | elem.SetAttribute("value", processorName);
69 | }
70 | else
71 | {
72 | elem = doc.CreateElement("add");
73 | elem.SetAttribute("key", key);
74 | elem.SetAttribute("value", processorName);
75 | node.AppendChild(elem);
76 | }
77 | doc.Save(getConfigFilePath());
78 | }
79 | catch
80 | {
81 | throw;
82 | }
83 | }
84 | private static XmlDocument loadConfigDocument()
85 | {
86 | XmlDocument doc = null;
87 | try
88 | {
89 | doc = new XmlDocument();
90 | doc.Load(getConfigFilePath());
91 | return doc;
92 | }
93 | catch (System.IO.FileNotFoundException e)
94 | {
95 | throw new Exception("No configuration file found.", e);
96 | }
97 | }
98 | private static string getConfigFilePath()
99 | {
100 | return @"C:\PrinterPlusPlus\PrinterPlusPlus.exe.config";
101 | }
102 |
103 | //public static void SetDefaultProcessor(string processorName)
104 | //{
105 | // Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
106 | // config.AppSettings.Settings["DefaultProcessor"].Value = processorName;
107 | // config.Save(ConfigurationSaveMode.Modified);
108 | // //ConfigurationManager.RefreshSection(sectionName);
109 | //}
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/PrinterPlusPlusSDK/Converters/Ghostscript.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | namespace PrinterPlusPlusSDK.Converters
20 | {
21 | public static class Ghostscript
22 | {
23 | public static string PSToTxt(string psFilename)
24 | {
25 | var retVal = string.Empty;
26 | var errorMessage = string.Empty;
27 |
28 | var command = "C:\\PrinterPlusPlus\\Converters\\gs\\gswin32c";
29 | var args = string.Format("-q -dNODISPLAY -P- -dSAFER -dDELAYBIND -dWRITESYSTEMDICT -dSIMPLE \"c:\\PrinterPlusPlus\\Converters\\gs\\ps2ascii.ps\" \"{0}\" -c quit", psFilename);
30 | retVal = Shell.ExecuteShellCommand(command, args, ref errorMessage);
31 | return retVal;
32 | }
33 |
34 | public static string PSToPdf(string psFilename, string pdfFilename)
35 | {
36 | var retVal = string.Empty;
37 | var errorMessage = string.Empty;
38 |
39 | var command = "C:\\PrinterPlusPlus\\Converters\\gs\\gswin32c";
40 | var args = string.Format("-q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=\"{1}\" -c save pop -f \"{0}\"", psFilename, pdfFilename);
41 | retVal = Shell.ExecuteShellCommand(command, args, ref errorMessage);
42 | return retVal;
43 | }
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/PrinterPlusPlusSDK/Converters/PdfToText.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | namespace PrinterPlusPlusSDK.Converters
20 | {
21 | public static class PdfToText
22 | {
23 | public static string Convert(string pdfFilename, string txtFilename)
24 | {
25 | var retVal = string.Empty;
26 | var errorMessage = string.Empty;
27 |
28 | var command = "C:\\PrinterPlusPlus\\Converters\\pdftotext\\pdftotext.exe";
29 | var args = string.Format("-q -f 1 -l 100 \"{0}\" \"{1}\"", pdfFilename, txtFilename);
30 | retVal = Shell.ExecuteShellCommand(command, args, ref errorMessage);
31 | return retVal;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/PrinterPlusPlusSDK/Extensions.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 |
20 | namespace PrinterPlusPlusSDK
21 | {
22 | using System;
23 | using System.Diagnostics;
24 | using System.Text.RegularExpressions;
25 | [DebuggerStepThrough]
26 | public static partial class Extensions
27 | {
28 | ///
29 | /// Extension method for String DataType.
30 | /// Converts String to Int.
31 | ///
32 | /// String to convert.
33 | /// Int datatype of the string after conversion.Zero(0) if conversion failed.
34 | public static int ToInt(this String value)
35 | {
36 | int retVal = 0;
37 | if (!string.IsNullOrEmpty(value))
38 | int.TryParse(value, out retVal);
39 | return retVal;
40 | }
41 |
42 | ///
43 | /// Extension method for Object DataType.
44 | /// Converts Object to Double.
45 | ///
46 | /// Object to convert.
47 | /// Double datatype of the string after conversion.Zero(0) if conversion failed.
48 | public static double ToDouble(this Object value)
49 | {
50 | Double retVal = 0;
51 | if (value != null && value.ToString() != string.Empty)
52 | double.TryParse(value.ToString(), out retVal);
53 | return retVal;
54 | }
55 |
56 | ///
57 | /// Extension method for String DataType.
58 | /// Converts String to Bool.
59 | ///
60 | /// String to convert.
61 | /// Bool datatype of the string after conversion.False if conversion failed.
62 | public static bool ToBool(this String value)
63 | {
64 | //bool retVal = false;
65 | //if (!string.IsNullOrEmpty(value))
66 | //{
67 | // bool.TryParse(value, out retVal);
68 | // if (retVal == false && value.ToInt() == 1)
69 | // retVal = true;
70 | //}
71 | //return retVal;
72 | return ToBool(value, false);
73 | }
74 | ///
75 | /// Extension method for String DataType.
76 | /// Converts String to Bool.
77 | ///
78 | /// String to convert.
79 | /// Boolean flag to set the result to true if the input object has value regardless of the content.
80 | /// Bool datatype of the string after conversion.False if conversion failed.
81 | public static bool ToBool(this String value, bool trueIfHasValue)
82 | {
83 | bool retVal = false;
84 | if (!string.IsNullOrWhiteSpace(value))
85 | {
86 | if (trueIfHasValue == false)
87 | {
88 | bool.TryParse(value, out retVal);
89 | if (retVal == false && value.ToInt() == 1)
90 | retVal = true;
91 | }
92 | else
93 | {
94 | if (value.Trim() != string.Empty)
95 | retVal = true;
96 | }
97 | }
98 | return retVal;
99 | }
100 |
101 | public static bool IsNumeric(this String value)
102 | {
103 | int retVal;
104 | return int.TryParse(value, out retVal);
105 | }
106 |
107 | public static string CleanSpaces(this String value, string replaceWith)
108 | {
109 | RegexOptions options = RegexOptions.None;
110 | Regex regex = new Regex(@"[ ]{2,}", options);
111 | return regex.Replace(value.Trim(), replaceWith);
112 | }
113 |
114 | public static string CleanGSComments(this String value)
115 | {
116 | RegexOptions options = RegexOptions.None;
117 | Regex regex = new Regex(@"%%\[.*?\]%%", options);
118 | return regex.Replace(value.Trim(), string.Empty);
119 | }
120 |
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/PrinterPlusPlusSDK/IO.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 |
20 | using System;
21 | using System.Configuration;
22 | using System.IO;
23 |
24 | namespace PrinterPlusPlusSDK
25 | {
26 | public static class IO
27 | {
28 | public static string ReadFile(string filename)
29 | {
30 | var retVal = string.Empty;
31 | using (var sr = new StreamReader(filename))
32 | {
33 | retVal = sr.ReadToEnd();
34 | }
35 | return retVal;
36 | }
37 |
38 | public static void WriteFile(string filename, string value)
39 | {
40 | using (var sw = new StreamWriter(filename, false))
41 | {
42 | sw.Write(value);
43 | sw.Flush();
44 | }
45 | }
46 |
47 | public static void Delete(string filename)
48 | {
49 | File.Delete(filename);
50 | }
51 |
52 | //public static void Print(string filename)
53 | //{
54 | // StartProcess(filename, "print");
55 | //}
56 |
57 | //public static void StartProcess(string filename)
58 | //{
59 | // StartProcess(filename, string.Empty);
60 | //}
61 |
62 | //public static void StartProcess(string filename, string startInfoVerb)
63 | //{
64 | // Process p = new Process();
65 | // p.StartInfo.FileName = filename;
66 | // p.StartInfo.UseShellExecute = true;
67 | // if (!string.IsNullOrWhiteSpace(startInfoVerb))
68 | // p.StartInfo.Verb = startInfoVerb;
69 | // p.EnableRaisingEvents = true;
70 | // p.Exited += new System.EventHandler(printJob_Exited);
71 | // p.Start();
72 |
73 | //}
74 |
75 | //static void printJob_Exited(object sender, System.EventArgs e)
76 | //{
77 | // eventHandled = true;
78 | //}
79 |
80 | public static void Log(string msg)
81 | {
82 | var debugMode = ConfigurationManager.AppSettings["DebugMode"].ToBool();
83 | if (debugMode == true)
84 | {
85 | var appDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
86 | var fileName = string.Format("{0}\\PrinterPlusPlus.log", appDir);
87 | using (var sw = new System.IO.StreamWriter(fileName, true))
88 | {
89 | sw.Write(string.Format("{0} - {1}\n", DateTime.Now, msg));
90 | sw.Flush();
91 | }
92 | }
93 | }
94 |
95 | public static bool IsFileLocked(string filename)
96 | {
97 | FileStream stream = null;
98 | FileInfo file = new FileInfo(filename);
99 | try
100 | {
101 | stream = file.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.None);
102 | }
103 | catch (IOException)
104 | {
105 | return true;
106 | }
107 | finally
108 | {
109 | if (stream != null)
110 | stream.Close();
111 | }
112 | return false;
113 | }
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/PrinterPlusPlusSDK/IProcessor.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | namespace PrinterPlusPlusSDK
20 | {
21 | public interface IProcessor
22 | {
23 | ProcessResult Process(string key, string psFilename);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/PrinterPlusPlusSDK/PrinterPlusPlusSDK.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}
9 | Library
10 | Properties
11 | PrinterPlusPlusSDK
12 | PrinterPlusPlusSDK
13 | v4.0
14 | 512
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | true
26 | full
27 | false
28 | bin\Debug\
29 | DEBUG;TRACE
30 | prompt
31 | 4
32 |
33 |
34 | pdbonly
35 | true
36 | bin\Release\
37 | TRACE
38 | prompt
39 | 4
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
71 |
--------------------------------------------------------------------------------
/PrinterPlusPlusSDK/ProcessResult.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System;
20 | namespace PrinterPlusPlusSDK
21 | {
22 | public class ProcessResult
23 | {
24 | public ProcessResult()
25 | {
26 | OutputFileName = null;
27 | HasException = false;
28 | Exception = null;
29 | }
30 | public ProcessResult(string outputFileName, bool hasException, Exception exception)
31 | {
32 | OutputFileName = outputFileName;
33 | HasException = hasException;
34 | Exception = exception;
35 | }
36 | public ProcessResult(Exception exception)
37 | {
38 | OutputFileName = null;
39 | HasException = true;
40 | Exception = exception;
41 | }
42 | public string OutputFileName { get; set; }
43 | public bool HasException { get; set; }
44 | public Exception Exception { get; set; }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/PrinterPlusPlusSDK/Processor.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | namespace PrinterPlusPlusSDK
20 | {
21 | [System.Diagnostics.DebuggerStepThrough]
22 | public class Processor
23 | {
24 | IProcessor processorObject;
25 |
26 | public Processor(IProcessor processorClass)
27 | {
28 | this.processorObject = processorClass;
29 | }
30 |
31 | public ProcessResult Process(string key, string postscriptInput)
32 | {
33 | return processorObject.Process(key, postscriptInput);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/PrinterPlusPlusSDK/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("PrinterPlusPlusSDK")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("PrinterPlusPlusSDK")]
13 | [assembly: AssemblyCopyright("Copyright © 2012")]
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("0db5d5d5-9cf3-4e58-84de-82439e09477d")]
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 Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/PrinterPlusPlusSDK/Shell.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System;
20 | using System.ComponentModel;
21 | using System.Diagnostics;
22 | using System.Threading;
23 | namespace PrinterPlusPlusSDK
24 | {
25 | public class Shell
26 | {
27 | private const int SLEEP_AMOUNT = 100;
28 | private Process p;
29 | private int elapsedTime;
30 | private bool eventHandled;
31 | public void StartProcess(string filename, string startInfoArgs, string startInfoVerb)
32 | {
33 | p = new Process();
34 | p.StartInfo.FileName = filename;
35 | if (!string.IsNullOrWhiteSpace(startInfoArgs))
36 | p.StartInfo.Arguments = startInfoArgs;
37 |
38 | if (!string.IsNullOrWhiteSpace(startInfoVerb))
39 | p.StartInfo.Verb = startInfoVerb;
40 |
41 | p.StartInfo.CreateNoWindow = true;
42 | p.EnableRaisingEvents = true;
43 | p.Exited += new EventHandler(p_Exited);
44 | p.Start();
45 |
46 | // Wait for Exited event, but not more than 30 seconds.
47 | while (!eventHandled)
48 | {
49 | elapsedTime += SLEEP_AMOUNT;
50 | if (elapsedTime > 30000)
51 | {
52 | break;
53 | }
54 | Thread.Sleep(SLEEP_AMOUNT);
55 | }
56 | }
57 | // Handle Exited event and display process information.
58 | private void p_Exited(object sender, System.EventArgs e)
59 | {
60 | eventHandled = true;
61 | }
62 |
63 |
64 | public static string ExecuteShellCommand(string fileToExecute, string args, ref string errorMessage)
65 | {
66 | //http://www.digitalcoding.com/Code-Snippets/C-Sharp/C-Code-Snippet-Execute-Shell-Commands-from-Net.html
67 | var retVal = string.Empty;
68 | try
69 | {
70 | using (var process = new Process())
71 | {
72 | string cmdProcess = string.Format(System.Globalization.CultureInfo.InvariantCulture, @"{0}\cmd.exe", new object[] { Environment.SystemDirectory });
73 | string arguments = string.Format(System.Globalization.CultureInfo.InvariantCulture, "/C {0}", new object[] { fileToExecute });
74 | if (args != null && args.Length > 0)
75 | arguments += string.Format(System.Globalization.CultureInfo.InvariantCulture, " {0}", new object[] { args, System.Globalization.CultureInfo.InvariantCulture });
76 |
77 | ProcessStartInfo _ProcessStartInfo = new ProcessStartInfo(cmdProcess, arguments);
78 | _ProcessStartInfo.CreateNoWindow = true;
79 | _ProcessStartInfo.UseShellExecute = false;
80 | _ProcessStartInfo.RedirectStandardOutput = true;
81 | _ProcessStartInfo.RedirectStandardInput = true;
82 | _ProcessStartInfo.RedirectStandardError = true;
83 | process.StartInfo = _ProcessStartInfo;
84 | process.Start();
85 | errorMessage = process.StandardError.ReadToEnd();
86 | process.WaitForExit();
87 | retVal = process.StandardOutput.ReadToEnd();
88 | process.WaitForExit();
89 | if (!string.IsNullOrWhiteSpace(errorMessage))
90 | IO.Log(string.Format("ExecuteShellCommand Error: {0}", errorMessage));
91 | }
92 | }
93 | catch (Win32Exception _Win32Exception)
94 | {
95 | IO.Log(string.Format("Win32 Exception caught in process: {0}", _Win32Exception.ToString()));
96 | }
97 | catch (Exception _Exception)
98 | {
99 | IO.Log(string.Format("Exception caught in process: {0}", _Exception.ToString()));
100 | }
101 | return retVal;
102 | }
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/Processors/Tutorial/EmailWeatherInCelcius/EmailWeatherInCelcius.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {C486D20E-6203-48BB-8BB4-92B00AC5FEC9}
9 | Library
10 | Properties
11 | EmailWeatherInCelcius
12 | EmailWeatherInCelcius
13 | v4.0
14 | 512
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | true
26 | full
27 | false
28 | bin\Debug\
29 | DEBUG;TRACE
30 | prompt
31 | 4
32 |
33 |
34 | pdbonly
35 | true
36 | bin\Release\
37 | TRACE
38 | prompt
39 | 4
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | {CA4547EC-4F9A-42A5-8AED-97E644C588C0}
58 | PrinterPlusPlusSDK
59 |
60 |
61 |
62 |
69 |
--------------------------------------------------------------------------------
/Processors/Tutorial/EmailWeatherInCelcius/Processor.cs:
--------------------------------------------------------------------------------
1 | /*
2 | Printer++ Virtual Printer Processor
3 | Copyright (C) 2012 - Printer++
4 |
5 | This program is free software; you can redistribute it and/or
6 | modify it under the terms of the GNU General Public License
7 | as published by the Free Software Foundation; either version 2
8 | of the License, or (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 | */
19 | using System;
20 | using System.Net.Mail;
21 | using PrinterPlusPlusSDK;
22 |
23 | namespace EmailWeatherInCelcius
24 | {
25 | public class Processor : PrinterPlusPlusSDK.IProcessor
26 | {
27 | public PrinterPlusPlusSDK.ProcessResult Process(string key, string psFilename)
28 | {
29 | //Convert PS to Text
30 | var txtFilename = System.IO.Path.GetTempFileName();
31 | ConvertPsToTxt(psFilename, txtFilename);
32 |
33 | //Process the converted Text File
34 | var extractedValue = ProcessTextFile(txtFilename);
35 |
36 | //Ask user for recipeint's email
37 | var recipients = Microsoft.VisualBasic.Interaction.InputBox("Enter email address of recipient.");
38 |
39 | //Send email if user entered an email address
40 | if (!string.IsNullOrWhiteSpace(recipients))
41 | {
42 | SendEmail(extractedValue, recipients);
43 | }
44 |
45 | return new ProcessResult();
46 | }
47 |
48 | public static string ConvertPsToTxt(string psFilename, string txtFilename)
49 | {
50 | var retVal = string.Empty;
51 | var errorMessage = string.Empty;
52 | var command = "C:\\ps2txt\\ps2txt.exe";
53 | var args = string.Format("-nolayout \"{0}\" \"{1}\"", psFilename, txtFilename);
54 | retVal = Shell.ExecuteShellCommand(command, args, ref errorMessage);
55 | return retVal;
56 | }
57 |
58 | public ExtractedValue ProcessTextFile(string txtFilename)
59 | {
60 | var values = new ExtractedValue(); //Create the extracted values placeholders
61 | var reachedMarker = false;
62 | //Read the text file
63 | using (System.IO.StreamReader sr = System.IO.File.OpenText(txtFilename))
64 | {
65 | while (sr.Peek() > -1)
66 | {
67 | var currentLine = sr.ReadLine().Trim();
68 |
69 | //Skip whitespaces
70 | if (string.IsNullOrWhiteSpace(currentLine))
71 | continue;
72 |
73 | //Checked if we've reached the marker to begin extraction
74 | if (reachedMarker == true)
75 | {
76 | //Get Title value
77 | if (string.IsNullOrWhiteSpace(values.Title))
78 | {
79 | values.Title = currentLine;
80 | continue;
81 | }
82 | //Skip Right Now value
83 | if (currentLine.ToLower() == "right now")
84 | continue;
85 | //Get UpdatedDateTime value
86 | if (string.IsNullOrWhiteSpace(values.UpdatedDateTime))
87 | {
88 | values.UpdatedDateTime = currentLine;
89 | continue;
90 | }
91 | //Get TemperatureFahrenheit and convert value to Celcius
92 | if (values.TemperatureFahrenheit == 0)
93 | {
94 | values.TemperatureFahrenheit = Convert.ToDouble(currentLine.Substring(0, currentLine.Length - 2));
95 | values.TemperatureCelcius = ((values.TemperatureFahrenheit - 32) / 1.8);
96 | continue;
97 | }
98 | //Get Forecast value
99 | if (string.IsNullOrWhiteSpace(values.Forecast))
100 | {
101 | values.Forecast = currentLine;
102 | break;
103 | }
104 | }
105 | //Mark farming so we can begin extracting data
106 | if (currentLine.ToLower() == "farming")
107 | reachedMarker = true;
108 | }
109 | }
110 | return values; //Return the extracted values
111 | }
112 |
113 | public class ExtractedValue
114 | {
115 | public string Title { get; set; }
116 | public string UpdatedDateTime { get; set; }
117 | public double TemperatureFahrenheit { get; set; }
118 | public double TemperatureCelcius { get; set; }
119 | public string Forecast { get; set; }
120 | }
121 |
122 | public void SendEmail(ExtractedValue values, string recipient)
123 | {
124 | try
125 | {
126 | var smtpHost = "mail.nightshade.arvixe.com";
127 | var sender = "info@printerplusplus.com";
128 | SmtpClient client = new SmtpClient(smtpHost, 26);
129 |
130 | client.UseDefaultCredentials = false;
131 | client.Credentials = new System.Net.NetworkCredential("rowell@opxsoftinc.com", "banana");
132 |
133 | MailAddress from = new MailAddress(sender);
134 | MailAddress to = new MailAddress(recipient);
135 | MailMessage message = new MailMessage(from, to);
136 | message.Body = values.Title;
137 | message.Body += Environment.NewLine;
138 | message.Body += values.UpdatedDateTime;
139 | message.Body += Environment.NewLine;
140 | message.Body += values.TemperatureCelcius;
141 | message.Body += Environment.NewLine;
142 | message.Body += values.Forecast;
143 | message.BodyEncoding = System.Text.Encoding.UTF8;
144 | message.Subject = "Printer++ EmailWeatherInCelcius";
145 | message.SubjectEncoding = System.Text.Encoding.UTF8;
146 | client.Send(message);
147 | message.Dispose();
148 | }
149 | catch (Exception ex)
150 | {
151 | //Error occured while sending email. Add code to handle error.
152 | }
153 | }
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/Processors/Tutorial/EmailWeatherInCelcius/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("EmailWeatherInCelcius")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("EmailWeatherInCelcius")]
13 | [assembly: AssemblyCopyright("Copyright © 2012")]
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("885e2447-a519-48e3-b4eb-bee4c84f1059")]
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 Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # printerplusplus
2 | Mirror for https://www.printerplusplus.com/Download
3 |
--------------------------------------------------------------------------------