Exemple #1
0
        private int RotateCardifPossible(int nres, SmartComm2.SMART_PRINTER_INFO DevInfo)
        {
            // print back pageand rotator is installed
            if (nres == SmartComm2.SM_SUCCESS & DevInfo.opt.is_dual == SmartComm2.VC_TRUE)
            {
                printerStatus   = "Printing";
                nres            = SmartComm2.SmartComm_DoPrint((long)hsmartprinterid);
                isCardPrintDone = true;
                printerStatus   = "Print Complete";
            }

            return(nres);
        }
Exemple #2
0
        private int UpdatePrinterSettings(int nres, SmartComm2.SMART_PRINTER_INFO DevInfo, int devGroup)
        {
            // change printer settings to both print, if possible
            if (DevInfo.opt.is_dual == SmartComm2.VC_TRUE)
            {
                if (devGroup == SmartComm2.GROUP_SMART50)
                {
                    nres = ConfigureSmart50(nres);
                }
                else if (devGroup == SmartComm2.GROUP_SMART51)
                {
                    nres = ConfigureSmart51(nres);
                }
            }

            return(nres);
        }
Exemple #3
0
        private int PrintCard(int nres, SmartComm2.SMART_PRINTER_INFO DevInfo)
        {
            // print
            if (nres == SmartComm2.SM_SUCCESS)
            {
                if (DevInfo.opt.is_dual == SmartComm2.VC_FALSE)
                {
                    nres = SmartComm2.SmartDCL_Print((long)hsmartprinterid, SmartComm2.SMART_PRINTSIDE_FRONT);
                }
                else
                {
                    nres = SmartComm2.SmartDCL_Print((long)hsmartprinterid, SmartComm2.SMART_PRINTSIDE_BOTH);
                }
            }

            return(nres);
        }
Exemple #4
0
        private static void AquireDeviceInformation(string strDesc, out IntPtr strDesc_ptr, out int nres, out SmartComm2.SMART_PRINTER_INFO DevInfo, out IntPtr DevInfo_ptr, out int devGroup)
        {
            // acquire destination device information
            strDesc_ptr = Marshal.StringToHGlobalUni(strDesc);
            DevInfo_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SmartComm2.SMART_PRINTER_INFO)));
            nres        = SmartComm2.SmartComm_GetDeviceInfo2((long)DevInfo_ptr, (long)strDesc_ptr, SmartComm2.SMART_OPENDEVICE_BYDESC);
            DevInfo     = (SmartComm2.SMART_PRINTER_INFO)Marshal.PtrToStructure(DevInfo_ptr, typeof(SmartComm2.SMART_PRINTER_INFO));
            Marshal.FreeHGlobal(DevInfo_ptr);

            devGroup = 0;
            switch ((DevInfo.std.pid >> 4))
            {
            case 0x385:
            {
                devGroup = SmartComm2.GROUP_SMART50;           // PRINTER_50
                break;
            }

            case 0x386:
            {
                devGroup = SmartComm2.GROUP_SMART50;           // PRINTER_50
                break;
            }

            case 0x387:
            {
                devGroup = SmartComm2.GROUP_SMART50;           // PRINTER_30
                break;
            }

            case 0x388:
            {
                devGroup = SmartComm2.GROUP_SMART50;           // PRINTER_30
                break;
            }

            case 0x370:
            {
                devGroup = SmartComm2.GROUP_SMART70;           // PRINTER_70
                break;
            }

            case 0x351:
            {
                devGroup = SmartComm2.GROUP_SMART51;           // PRINTER_51
                break;
            }

            case 0x331:
            {
                devGroup = SmartComm2.GROUP_SMART51;           // PRINTER_31
                break;
            }
            }
        }