in reply to sending a control signal to a scanner

Already been shown what to do, but as to why:

Control-D (\cD, 0x4, call it what you will) sent on a TTY causes end of file to be set on the descriptor (by default; technically of course you can use stty or the corresponding underlying termios calls to change the eof character to whatever you'd like). If the child process isn't running on a PTY then sending it a Ctrl-D is just like sending it any other character.