* * *

Author Topic: fpSystem - scanimage  (Read 206 times)

yvanbelle

  • Newbie
  • Posts: 2
fpSystem - scanimage
« on: September 14, 2017, 05:06:26 pm »
Hello,

I did search the internet, this forum, and I can not find a solution to my problem. When I scan from my Ubuntu 16.04 AMD64 from the command line with the command

scanimage --batch > /home/yves/out

It works fine. When I do this from within Lazarus I don't get any images, without the --batch option, but with other options it works fine:

fpSystem('/usr/bin/scanimage "--batch" > /home/yves/out');    // doesn't work

fpSystem('/usr/bin/scanimage -- resolution 100 > /home/yves/out');     // works fine
 
Thanks for helping,

Yves

yvanbelle

  • Newbie
  • Posts: 2
Re: fpSystem - scanimage
« Reply #1 on: September 14, 2017, 08:41:12 pm »
Ok, I did some experimenting and found the solution. I hope I can help someone with this solution in the future:

  chdir('/home/yves');
  cmdexe:='scanimage -b --resolution=100 --format=tiff';
  cmdreturn:=fpSystem(cmdexe);

The redirection must be removed when batch scanning from the ADF.
« Last Edit: September 15, 2017, 08:44:05 am by yvanbelle »

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus