Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plustek SmartOffice PS286 user interface issues with the "Exit" button disabled #83

Open
dynarithmic opened this issue Oct 27, 2023 · 2 comments

Comments

@dynarithmic
Copy link
Owner

dynarithmic commented Oct 27, 2023

It seems that the following device has an issue:

  • Plustek SmartOffice PS286, and probably scanners that are related to this one
  • Twain Driver 6.4.0.2 (Internal version 1.0.6.22334 2020/09/02)

The issue is that if the scanner user-interface is shown, the "Exit" button may become permanently grayed-out and disabled, thus not making it possible to close out the user interface after scanning is done.

Enabled Exit Button:
exitbtn

Grayed/Disabled Exit Button after scanning less pages than the number of pages in the feeder:
exitbtn_disabled

To duplicate the scenario:

  • Place 2 (or more) sheets in the document feeder.
  • Make sure you did not call DTWAIN_SetMaxAcquire() before this test
  • Call DTWAIN_AcquireNative (or any DTWAIN_Acquire... function) and show the scanner user interface, making sure that the page count parameter is less than the number of pages in the document feeder. For example, if 3 pages are in the document feeder, specify 1 or 2 as the number of pages to scan in the DTWAIN_Acquire call.
  • Make sure you do not choose duplex for this test in the scanner UI.
  • Start the scan by selecting "Scan" on the user interface.

In other words, the following short code snippet should describe this:

DTWAIN_SOURCE source = DTWAIN_SelectSource(); // select the Plustek Smartoffice PS286
//... Now place more than one page in the document feeder
if ( source )
{
    DTWAIN_AcquireNative(source, DTWAIN_PT_DEFAULT, 1, 1, 0, NULL); // acquire just one page and show the UI
    //... Make sure you do not choose ADF duplex (choose either ADF front side or ADF rear side)
    //...Hit the scan button
}

What will happen is that the Plustek user interface will fail to enable the "Exit" button on their interface after the pages have been scanned, thus there is no way, other than killing the task using the Task Manager, to exit the application. This should not be the case, as the driver knows that the scan count is 0 (after debugging this was confirmed), so the driver should have enabled the Exit button on the user interface when the single page was scanned.

This behavior from the Plustek scanner only happens if the number of pages scanned will be less than the number of pages in the document feeder, and only when the user interface is shown. Specifying DTWAIN_ACQUIREALL or using a page number that is equal or greater to the number of pages in the document feeder, then the user interface works correctly.

Testing against an Hewlett-Packard scanner shows no issues -- the scanner properly processes the pages in the feeder if the number of pages scanned is less than the number of pages in the feeder.

The current workaround for this is to always specify DTWAIN_ACQUIREALL as the number of pages to scan, or scan without the user-interface being shown. I will keep this issue opened for the time being, and will close it if there is no easy resolution (if I had access to the Plustek driver source code, it would be a simple fix, but that's life).

@dynarithmic
Copy link
Owner Author

This issue is related to #81

@dynarithmic
Copy link
Owner Author

This aspect of how a driver is supposed to behave is defined in the TWAIN specification as "transitioning from "State 6 to State 5" when the driver detects that there are no more pages to scan.

Basically State 6 is the state where images are being acquired / scanned, and State 5 is the state where the user-interface is enabled, but also ready to scan more pages by the user if desired.

The Plustek driver, even though the driver itself states that no more pages are available to scan, does not return to State 5, thus the "Exit" button remains grayed out as if there are more pages to scan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant