public bool hasPlaten; //是否有平板 public void GetPaperSource() { if (twSession.defaultScannerName.ToLower().Contains("kodak")) { capId = TwCap.CAP_PAPERSOURCE; CapItem capItem = twSession.GetCapabilitySupportedDataList(TwCap.CAP_PAPERSOURCE); CapType = capItem.listDataType; CurrentIntStr = twSession.GetCapabilityCurrentValue(TwCap.CAP_PAPERSOURCE, ref capType); DefaultIntStr = twSession.GetCapabilityDefaultValue(TwCap.CAP_PAPERSOURCE, ref capType); if (capItem.list != null && capItem.list.Count == 3) { hasPlaten = true; if (valueList == null) { valueList = new ArrayList(); } valueList.Clear(); valueList.Add(PaperSouceString.ADF); valueList.Add(PaperSouceString.Platen); } //如果是自动模式,则设置为送纸器 if (currentIntStr.Equals("0")) { bool flag = SetCap("1"); if (flag) { currentIntStr = "1"; } } capId = TwCap.ECAP_PAPERSOURCE; } }
/// <summary> /// 设置佳能型号的纸张来源 /// </summary> private bool SetCanonPaperSource() { string sourceVal = "0";//默认为自动 //1:检查是否带有平板 bool autoFlag = false; CapItem capItem = twSession.GetCapabilitySupportedDataList(TwCap.CCAP_CEI_DOCUMENT_PLACE); if (capItem.list.Count == 3) { autoFlag = true; } //2:如果没有平板,需要修改应用设置 if (!autoFlag) { PaperSourceFlag = PaperSource.Feeder; } //3:根据应用设置进行能力设置 switch (PaperSourceFlag) { case PaperSource.Auto: sourceVal = "0"; break; case PaperSource.Feeder: sourceVal = "2"; break; case PaperSource.Platen: sourceVal = "1"; break; default: break; } bool flag = twSession.SetCapability(TwCap.CCAP_CEI_DOCUMENT_PLACE, sourceVal); return(flag); }