$ hp-scan -r 200 -mcolor -dhpaio:/net/HP_LaserJet_Pro_MFP_M125rnw?ip=*** HP Linux Imaging and Printing System (ver. 3.17.10) Scan Utility ver. 2.2 Copyright (c) 2001-15 HP Development Company, LP This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to distribute it under certain conditions. See COPYING file for more details. warning: No destinations specified. Adding 'file' destination by default. Using device hpaio:/net/HP_LaserJet_Pro_MFP_M125rnw?ip=*** Opening connection to device... Resolution: 200dpi Mode: color Compression: JPEG Scan area (mm): Top left (x,y): (0.000000mm, 0.000000mm) Bottom right (x,y): (215.899994mm, 296.925995mm) Width: 215.899994mm Height: 296.925995mm Destination(s): file Output file: warning: File destination enabled with no output file specified. Setting output format to JPEG for color/lineart mode. warning: Defaulting to '/home/***/hpscan001.jpg'. Warming up... Scanning... Reading data: [**************************************************************************] 100% 11.4 MB Read 11.4 MB from scanner. Closing device. Outputting to destination 'file': Saving to file /home/***/hpscan001.jpg error: Error saving file: cannot write mode RGBA as JPEG (I/O) $ hp-scan -r 200 -spdf -mcolor -dhpaio:/net/HP_LaserJet_Pro_MFP_M125rnw?ip=*** HP Linux Imaging and Printing System (ver. 3.17.10) Scan Utility ver. 2.2 Copyright (c) 2001-15 HP Development Company, LP This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to distribute it under certain conditions. See COPYING file for more details. Using device hpaio:/net/HP_LaserJet_Pro_MFP_M125rnw?ip=*** Opening connection to device... Resolution: 200dpi Mode: color Compression: JPEG Scan area (mm): Top left (x,y): (0.000000mm, 0.000000mm) Bottom right (x,y): (215.899994mm, 296.925995mm) Width: 215.899994mm Height: 296.925995mm Destination(s): pdf Warming up... Scanning... Reading data: [**************************************************************************] 100% 11.4 MB Read 11.4 MB from scanner. Closing device. Sending to destination 'pdf': Traceback (most recent call last): File "/usr/bin/hp-scan", line 1135, in c.drawInlineImage(im, (tlx/0.3528), (tly/0.3528), ((brx-tlx)/0.3528),((bry-tly)/0.3528)) File "/usr/lib64/python2.7/site-packages/reportlab/pdfgen/canvas.py", line 826, in drawInlineImage img_obj = PDFImage(image, x,y, width, height) File "/usr/lib64/python2.7/site-packages/reportlab/pdfgen/pdfimages.py", line 40, in __init__ self.getImageData() File "/usr/lib64/python2.7/site-packages/reportlab/pdfgen/pdfimages.py", line 165, in getImageData imagedata, imgwidth, imgheight = self.PIL_imagedata() File "/usr/lib64/python2.7/site-packages/reportlab/pdfgen/pdfimages.py", line 125, in PIL_imagedata raw = myimage.tostring() File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 738, in tostring raise NotImplementedError("tostring() has been removed. " NotImplementedError: tostring() has been removed. Please call tobytes() instead.