I would like to scan an image with my HP3570c scanner and store the result in a file .jpg or .PDF

I look for a sample code.

PS : is it depending of the scanner or the object used are valid for all scanner ?

Thanks for your help