[sane-devel] Correct way to know if ADF is in use?
m. allan noah
kitno455 at gmail.com
Thu May 28 16:06:49 UTC 2009
On Thu, May 28, 2009 at 9:15 AM, Mark Pemburn <mark at pemburn.com> wrote:
> Allan,
>
> Thanks. I've added a "Multi-page" checkbox to my interface and that
> part works fine; when it's checked and I'm scanning with a ADF, I get all
> pages and drop out of the loop after the last page. When the box is not
> checked, I can scan with the flatbed and exit the loop after the scan.
> Problem is, if the box is checked while I'm using the flatbed, it just goes
> back and scans the same page again. I should put a "Place next page on
> scanner" modal dialog box in the loop . . . but . . . if I do that, then the
> user gets the dialog box between each page even when using an ADF. No fun
> if you're scanning a 50 page document! The only way I can think of to get
> around this is to _know_ whether or not an ADF's in use. You say there
> isn't any way?
that's what i said :) seriously, if the user asks for a multi-page
scan, using an adf, they better be quick, or you should add another
option that lets them set the length of a pause between pages.
allan
Here's my code:
>
> do {
> status = [sane Scan];
> if (status == SANE_STATUS_NO_DOCS)
> break;
> NSImage * image = [sane GetCurrentImage];
> [imageStore addObject: image];
> [DisplayImage setImage: image];
> [DisplayImage display];
> currentPageNumber++;
> } while (status == SANE_STATUS_EOF && isMultiPage);
>
> Regards,
>
> Mark
>
> ************
>
> m. allan noah wrote:
>
> you cannot know, and you should not assume that just because a user
> has an adf that they want to scan all sheets. ask them.
>
> allan
>
> On Wed, May 27, 2009 at 6:07 PM, Mark Pemburn <mark at pemburn.com> wrote:
>
>
> Hi y'all,
>
> Just got a Fujitsu fi-5120Cdj to play with and the contrast with my little
> Canon has provided a great education as I compare the features exposed by
> the SANE back ends. The Fujitsu is a sheetfeed-only scanner and the Canon
> is a flatbed-only. I have learned how to scan multi-page documents by
> looping over my "Scan" routine while the status is SANE_STATUS_EOF --
> however, this won't work for the flatbed because it returns that same status
> when it's done. Unless there's something I'm missing, it looks like the
> only way I can differentiate between the two actions is to have some way to
> tell whether I'm using an ADF or not. The "type" member of the SANE_Device
> structure for the Canon is "flatbed scanner" and the Fujitsu merely says
> "scanner" so that's no help. The only other thing is to test whether the
> substring "ADF" appears in the currently selected "source" option but this
> seems kind of bogus. Any suggestions?
>
> Regards,
>
> Mark
>
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
> to sane-devel-request at lists.alioth.debian.org
>
>
>
>
>
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
> to sane-devel-request at lists.alioth.debian.org
>
--
"The truth is an offense, but not a sin"
More information about the sane-devel
mailing list