Scanner (SHARP MX-3060N) scans pages then throws feeder empty exception C# WPF #401
ProgrammamentazioniVariegate
started this conversation in
Support
Replies: 1 comment
-
The example code has two scans ("Scan and save images" then "Scan and save PDF"), so it scans successfully the first time and errors the second time. You can delete the one you don't want to do. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I will begin saying I'm not an expert so if there's already a solution to this or this isn't the right place to post this I apologize and I'll correct it.
That said I tried scanning with my printer a bunch of paper and have it convert it int PDF docs using the code posted in the NAPS2 SDK .NET:
// Set up
using var scanningContext = new ScanningContext(new GdiImageContext());
var controller = new ScanController(scanningContext);
// Query for available scanning devices
var devices = await controller.GetDeviceList();
// Set scanning options
var options = new ScanOptions
{
Device = devices.First(),
PaperSource = PaperSource.Feeder,
PageSize = PageSize.A4,
Dpi = 300
};
// Scan and save images
int i = 1;
await foreach (var image in controller.Scan(options))
{
image.Save($"page{i++}.jpg");
}
// Scan and save PDF
var images = await controller.Scan(options).ToListAsync();
var pdfExporter = new PdfExporter(scanningContext);
await pdfExporter.Export("doc.pdf", images);
When I attempt to run the program I get this exception:
An exception of type 'NAPS2.Scan.Exceptions.DeviceFeederEmptyException' occurred in System.Private.CoreLib.dll but was not handled in user code
Non ci sono fogli nell'alimentatore automatico.
(There are no papers in the automatic feeder) even though it scans the pages in the feeder.
What am I missing?
I have deadlines and coworkers will realize I'm bad at coding lol please help.
Best regards,
A nervous imposter.
Beta Was this translation helpful? Give feedback.
All reactions