i want to add a device property to continously scan papers using scanjet pro f1 in c# windows forms, only this device.Properties["3088"].set_Value(5); // 5 = duplex (front back) is working but the continous scan, please hel
Loading
i want to add a device property to continously scan papers using scanjet pro f1 in c# windows forms, only this device.Properties["3088"].set_Value(5); // 5 = duplex (front back) is working but the continous scan, please hel
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Abhishek YadavRank #217 · 11.3K reputationPosted Sep 25, 2024, 1:06 AM EDT
To continuously scan documents using the ScanJet Pro F1 in a C# Windows Forms application, you'll need to set up a loop that continuously retrieves and processes scans. Below is a simplified example of how to accomplish this, along with the configuration for duplex scanning.
Prerequisites- Ensure you have the necessary drivers installed for the ScanJet Pro F1.
- Include references to the appropriate imaging libraries, like WIA (Windows Image Acquisition) or TWAIN.
Sample CodeHere's a basic example using WIA:
using System; using System.Windows.Forms; using WIA; namespace ContinuousScanningApp { public partial class MainForm : Form { private Device scanner; private bool isScanning; public MainForm() { InitializeComponent(); InitializeScanner(); } private void InitializeScanner() { var wia = new WIA.ImageFile(); var deviceManager = new DeviceManager(); // Select the desired scanner foreach (DeviceInfo deviceInfo in deviceManager.DeviceInfos) { if (deviceInfo.Type == WIA.WiaDeviceType.ScannerDeviceType) { scanner = deviceInfo.Connect(); break; } } if (scanner != null) { // Set duplex mode scanner.Properties["3088"].set_Value(5); // 5 = duplex } else { MessageBox.Show("Scanner not found."); } } private void StartScanningButton_Click(object sender, EventArgs e) { isScanning = true; ContinuousScan(); } private void StopScanningButton_Click(object sender, EventArgs e) { isScanning = false; } private void ContinuousScan() { while (isScanning) { try { // Acquire an image from the scanner ImageFile image = (ImageFile)scanner.Transfer(FormatID.wiaFormatJPEG); // Process the scanned image (save/display) ProcessImage(image); } catch (Exception ex) { MessageBox.Show($"Error during scanning: {ex.Message}"); break; } } } private void ProcessImage(ImageFile image) { // Save the image or display it string filePath = $"C:\\ScannedImages\\scan_{DateTime.Now:yyyyMMdd_HHmmss}.jpg"; image.SaveFile(filePath); } } }Stein Makhambera28 reputationPosted Sep 25, 2024, 2:37 AM EDT
thanks for the reply Abhishek Yadav, now continous scanning is working but it is resting in between scans, i want to scan one after another without resting until the feeder is empty and if i run with this line of code
// Enable continuous scanning
device.Properties["3104"].set_Value(1);
it is showing error >>E_ACCESSDENIED <<<
help me to fix it.