cyanfish / naps2

Scan documents to PDF and more, as simply as possible.
https://www.naps2.com
Other
2.71k stars 320 forks source link

Scan with NativUI or Dialog with Parameter not work #450

Open schorges opened 1 week ago

schorges commented 1 week ago

Is your feature request related to a problem? Please describe. When i scan (Brother MFC 6890 CDW with Feeder) with the UI and WIA (see Picture) i can choose Feeder (Einzug) and the Picture is croped fine. On doing the same and open the Dialog, the changes before are not stored and i have to change the PaperSource, DPI and PageSize on every scan again and again. On Twain it works with Scan-Software nice, but i need x64 and it's not compatible.

Describe the solution you'd like Save the Scan Parameter as Standart and initial this on open the UI again.

Describe alternatives you've considered Alternativly scanning without the Wizward UI, on there i have a part of the left side of my documents and cut off, Aligment to center or left/right not work, only with NativeUI is the complete Scan successfull.

Additional context image

var imageContext = GetImagecontext();
using var scanningContext = new ScanningContext(imageContext);

var scanController = new ScanController(scanningContext);
var devices = await scanController.GetDeviceList(Driver.Wia);
var device = GetUserDevice(devices);
var options = new ScanOptions();

if (showWizard)
{
    options = new ScanOptions
    {
        Device = device,
        Driver = Driver.Wia,
        PaperSource = PaperSource.Feeder,
        Dpi = 150,                        
        UseNativeUI = true,
        PageSize = PageSize.A4
    };
}
else
{
    options = new ScanOptions
    {
        Device = device,
        Driver = Driver.Wia,
        PaperSource = PaperSource.Feeder,
        Dpi = 150,
        PageSize = PageSize.A4
    };
}

Version 1.1.2 NASP2.Sdk from NuGet

cyanfish commented 1 week ago

The native dialog doesn't come from NAPS2 and can't be changed in any way. You can try setting OffsetWidth on ScanOptions.WiaOptions to fix the cutoff issue.

cyanfish commented 1 week ago

You can also set up a worker to use TWAIN on x64.