QUOTE
Yes in fact I've done a lot of crooping manually but I have many
many pages to process, so I really need a program !
Agreed. So lets see... if someone knows anything about photoshop plug-ins (which I don't) I bet that such a program would not be too hard to do since photoshop has all the tools you would ever need/want.
Assuming that the images are not all broken up the same way...
To do it in C/C++ first find a good JPG library. Use it to load the image uncompressed into a buffer. Next you will look for horizontal/vertical lines of white (or white-ish) that will connect with the border. I would do this by selecting a grid of test points probably about 5-pixels wide. Then I would look for horizontal and vertical lines of white in these test points. If I am able to form a box large enough (and possibly not within another box) then I would copy that region to another buffer and save.
You know, if you don't know/want to learn C (which might take a while), and you are on a PC, I would use AutoHotkey. It is a macro scripting language that you can use with Photoshop (well you can automate any windows program with it). Basically you would do the same thing as above but you would move the mouse cursor to get the points, then move the mouse cursor to select etc... Definitely not as fast as the C/C++ program (which could probably do about an image a second or better) but it would allow you to sort of oversee the operation.
AutoHotkey has a rather easy learning curve if you already know how to program in a language as you can record keystrokes/mouse movement etc and then edit them -- so it lets you see the syntax for accomplishing a given task, then you just add in the variables and loops etc. to automate the process. You can add in key-combos to control the macro as it is running (so for instance pressing ctrl+z pauses the macro) so if you see someplace where the program is failing you can intervene.
I also think you can write scripts for PS in Python (I know you can in PSP 8 or better). Again this may be easier than C/C++.