Sticky
SULDR Forums Supported Printers Printing Questions Scanning Questions General Questions Samsung Installer

Author Topic: Scan to PC problem with SCX-4728FD  (Read 8271 times)

jmaris

  • Testing the water
  • **
  • Posts: 4
    • View Profile
  • Linux Distribution: Debian 7.0 Wheezy
  • Printer: SCX-4728FD
Scan to PC problem with SCX-4728FD
« on: August 09, 2013, 08:45:24 »
Hello,

I own a Samsung SCX-4728FD multifunction device.

The printer driver worked like a charm, but I am facing some issues with scantopc application.

I installed from the repository which was updated today on my laptop which is running debian 7.0

The function works pretty well when I choose JPEG as the format.

But when I choose PDF format the scan fails to complete and I get the following error in logs:

08-09-13 15:33:21 stdout       INFO     Waiting for user selection ...
08-09-13 15:33:30 stdout       INFO         Got it!
08-09-13 15:33:30 stdout       INFO     Options selected by user: {'name': 'Gray-S_PDF-75', 'format': 'FORMAT_PDF', 'color': 'COLOR_GRAY', 'filters': [], 'output': '${homedir}/Downloads/Scans/SCAN_${date}__${uid}', 'resolution': 'DPI_75', 'size': 'SIZE_A4'}
08-09-13 15:33:30 stdout       INFO     MODE: Grayscale - 256 Levels
08-09-13 15:33:30 stdout       INFO     DPI: 75
08-09-13 15:33:30 stdout       INFO     SIZE: A4 - 210x297 mm
08-09-13 15:33:30 stdout       INFO     Scanning ...
08-09-13 15:33:45 stderr       INFO     Whoops! Problem scanning (maybe version Samsung device driver >= 4.1 and multi-scan?):
08-09-13 15:33:45 stderr       INFO     Traceback (most recent call last):
08-09-13 15:33:45 stderr       INFO       File "/usr/bin/samsungScannerServer.py", line 466, in scanAndSave
08-09-13 15:33:45 stderr       INFO         fileName=baseFileName+'.'+EXTENSIONS[user_selection["format"]] #t-k: seperate baseFileName
08-09-13 15:33:45 stderr       INFO     KeyError: 'FORMAT_PDF'
08-09-13 15:33:48 stdout       INFO     Waiting for scan job ...

Similar log errors for every available PDF options.

My config is:

##
##  Config file for the samsung scanner server
##

## Change to True after adapting your settings (False otherwise)
ENABLED_SERVER=True

## t-k: change to True if you want to use the modified classes of the sane module and TCP/UDP
##      proxies which were optimized for CLX-3305W multipage scanning support (False otherwise)
MODIFIED_SANE=False
## t-k: debug level of proxies: 0 = nothing at all, 1 = very light, 2 = a bit more, 3 = every package
PROXY_DEBUGLEVEL=1
## t-k: if you aim to use more than one server at a time with your scanner change to False
SCANNER_CACHING=True

## t-k: now possible to comment out everything before OUTPUT_PREFIX for automatic configuration
##      (this takes longer for SCANNER_SANE_NAME)

##  SANE name of the scanner
##  Find with "scanimage -L" or comment out to use the first detected SAMSUNG scanner
#SCANNER_SANE_NAME='smfp:SAMSUNG CLX-3300 Series on 192.168.178.29'
SCANNER_SANE_NAME='smfp:SAMSUNG SCX-472x Series on 192.168.2.6'

## Name to display in the scanner screen, defaults to hostname of server running machine
#SERVER_NAME='server'
SERVER_NAME='j'

## t-k: Linux username and/or userid (uid) of the future owner of scan files
#OWNER_UID=1000 ## t-k: defaults to 1000 (e.g. first ubuntu user)
#OWNER='username'
OWNER='j'

## By default files are saved to ~/Scans/. If something else is wanted change in OUTPUT_PREFIX.
##     ~ is the HOME directory of the 'first' user (the one with uid 1000) (default)
##     or the one by the user given above

## Output file names. #t-k folder doesn't have to exist (is now created automatically)
OUTPUT_PREFIX='${homedir}/Downloads/Scans/SCAN_${date}__${uid}' ## t-k: automatic home dir, uid zero padded

##  Contrast filter used in OPTIONS
##  The filter functions receive a python image object and return a modified one
##  For more details: http://www.pythonware.com/library/pil/handbook/index.htm
def contrastFilter(im):
    ## Filter the 10% bridgest and darkest colors
    return ImageOps.autocontrast(im,10)

## Options to offer in the scanner -> check <scanner IP>/DPI/cap.xml or <scanner IP>/IDS/CAP.XML
OPTIONS=[
    {'name':'Gray-M_PDF-300' ,'color':'COLOR_GRAY','resolution':'DPI_300','format':'FORMAT_M_PDF','size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
    {'name':'Color-M_PDF-300','color':'COLOR_TRUE','resolution':'DPI_300','format':'FORMAT_M_PDF','size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
    {'name':'Gray-JPEG-300'  ,'color':'COLOR_GRAY','resolution':'DPI_300','format':'FORMAT_JPEG' ,'size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
    {'name':'Color-JPEG-300' ,'color':'COLOR_TRUE','resolution':'DPI_300','format':'FORMAT_JPEG' ,'size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
    {'name':'Gray-M_PDF-75'  ,'color':'COLOR_GRAY','resolution':'DPI_75' ,'format':'FORMAT_M_PDF','size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
    {'name':'Gray-S_PDF-75'  ,'color':'COLOR_GRAY','resolution':'DPI_75' ,'format':'FORMAT_S_PDF','size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
]

## Convertion tables
## t-k: might need some device-specific tweaking (especially SIZE2SANE)
##      see scanimage --help, and look at device options
MODES2SANE={'COLOR_MONO':'Black and White - Line Art', 'COLOR_GRAY':'Grayscale - 256 Levels','COLOR_TRUE':'Color - 16 Million Colors'}
#SIZE2SANE={'SIZE_A4':'A4','SIZE_A5':'A5','SIZE_B5_JIS':'B5 (JIS)','SIZE_EXECUTIVE':'Executive','SIZE_LETTER':'Letter','SIZE_LEGAL':'Legal','SIZE_FOLIO':'Folio'}
SIZE2SANE={'SIZE_A4': 'A4 - 210x297 mm', 'SIZE_A5': 'A5 (Rotated) - 210x148 mm',
           'SIZE_B5_JIS': 'B5 (JIS) - 182x257 mm', 'SIZE_EXECUTIVE': 'Executive - 7.25"x10.5"',
           'SIZE_LETTER': 'Letter - 8.5"x11"'}
EXTENSIONS={'FORMAT_S_PDF':'pdf','FORMAT_M_PDF':'pdf','FORMAT_JPEG':'jpg','FORMAT_S_TIFF':'tiff','FORMAT_M_TIFF':'tiff'}

## logging settings
LOG_NAME="/var/log/samsungScannerServer.log" ## If commented out then the logging to a file will be dissabled
LOG_MAXBYTES=100000
LOG_BACKUPCOUNT=1


I tried with the modified sane value set to true but in this case the scan stops earlier with connection issues.

Any ideas would be welcome.

Thank you in advance.

angelnu

  • Soaking wet
  • ****
  • Posts: 19
    • View Profile
  • Linux Distribution: Ubuntu 12.10
  • Printer: CLX-3300
Re: Scan to PC problem with SCX-4728FD
« Reply #1 on: August 10, 2013, 03:19:41 »
Hi jmaris,

it looks like your scanner has a different setting than mine: 'FORMAT_PDF' Mine offers FORMAT_M_PDF (multi-page PDF) or FORMAT_S_PDF (one PDF per scanned page).

Please update the EXTENSIONS line in your config file to:

    EXTENSIONS={'FORMAT_PDF':'pdf','FORMAT_S_PDF':'pdf','FORMAT_M_PDF':'pdf','FORMAT_JPEG':'jpg','FORMAT_S_TIFF':'tiff','FORMAT_M_TIFF':'tiff'}

and give it a try. I would expect that you get one PDF for each scanned page. With a small fix in /usr/bin/samsungScannerServer.py we can get all scanned pages in one PDF:

    #Concat PDFs and delete temp ones
--    if user_selection["format"] == "FORMAT_M_PDF" and (len(outputFiles)>1):
++  if (user_selection["format"] == "FORMAT_M_PDF" or user_selection["format"] == "FORMAT_PDF") and (len(outputFiles)>1):


jmaris

  • Testing the water
  • **
  • Posts: 4
    • View Profile
  • Linux Distribution: Debian 7.0 Wheezy
  • Printer: SCX-4728FD
Re: Scan to PC problem with SCX-4728FD
« Reply #2 on: August 10, 2013, 07:41:07 »
Thanks a lot for the quick responce.

The printer is in my office and I am on vacation from today for two weeks :), so I will give it a try when I get back and post the results.

Btw, you guys are doing a great job supporting samsung printers with your work.

Cheers.

jmaris

  • Testing the water
  • **
  • Posts: 4
    • View Profile
  • Linux Distribution: Debian 7.0 Wheezy
  • Printer: SCX-4728FD
Re: Scan to PC problem with SCX-4728FD
« Reply #3 on: August 26, 2013, 03:04:10 »
I just tried the proposed solution and it worked like a charm.

Of course I also had to add the following options in the config file:
    {'name':'Gray_PDF-300' ,'color':'COLOR_GRAY','resolution':'DPI_300','format':'FORMAT_PDF','size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
    {'name':'Color_PDF-300','color':'COLOR_TRUE','resolution':'DPI_300','format':'FORMAT_PDF','size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},

It does take more time to scan multiple pages compared to a windows pc, but as I read in another thread this is a different issue.

So I can confirm that with these modifications scan to pc function also works for SCX-4728FD model.

Thank you very much for all the help.

angelnu

  • Soaking wet
  • ****
  • Posts: 19
    • View Profile
  • Linux Distribution: Ubuntu 12.10
  • Printer: CLX-3300
Re: Scan to PC problem with SCX-4728FD
« Reply #4 on: August 27, 2013, 02:55:48 »
Glad to hear that! Please do not forget to update the list of working models :-)

The scan time is larger since the sane driver is transfering the image in RAW format. The Windows driver directly transfer it in JPEG format and therefore it is faster.

bchemnet: should I take the latest version of the script in your package and make the change there or should we updload the sources to a source repository and do the changes there?

bchemnet

  • Administrator
  • *****
  • Posts: 524
    • View Profile
  • Linux Distribution: Debian Testing
  • Printer: none
Re: Scan to PC problem with SCX-4728FD
« Reply #5 on: September 12, 2013, 10:20:57 »
Sorry the delay, I'm working a crazy schedule at the moment.

For now, you can just make the change to the latest version and post, I'll pull it and update the package.  For now I'm more likely to get around to dealing with it that rather than with a separate source repository, although that may be something worth considering in the future.

totally-king

  • Expert swimmer
  • *****
  • Posts: 28
  • skills: python, Perl, R, bash
    • View Profile
  • Linux Distribution: Ubuntu 12.10 (quantal)
  • Printer: CLX-3305W
Re: Scan to PC problem with SCX-4728FD
« Reply #6 on: October 01, 2013, 09:00:48 »
I posted updated source and config files (also tackling this issue) in the development thread: click!

Edit: I posted newer versions (both 0.4.5) here.
« Last Edit: October 02, 2013, 15:47:54 by totally-king »

 

Repository Information Legal Contact Alternative Drivers