How to set default file type PNG for Simple Scan?

Solution 1:

Simple Scan stores its settings in dconf database rather then in your profile. Its keys can be listed by the command:

gsettings list-keys $(gsettings list-schemas | grep -i 'simple' | grep -i 'scan')

As you can see, there's no mentioning about the preferable file format.

At the page of its developers I also found confirmation that there's no way of saving your preferred file format permanently: https://answers.launchpad.net/simple-scan/+question/273400
This info is pretty fresh. Maybe someday they'll add this functionality, but now default file type is PDF. Older versions of application were more adaptive - they used PDF as default file type for 'Text' and JPG as default file type for 'Image'. This behavior is hardcoded. Modifying the source and recompiling seems the single way to overcome that.

Solution 2:

As @whtyger says, there is no way to do this but modifying the source code.


However you can use this workaround:

  1. Run this command to install imagemagick:

    sudo apt-get install imagemagick
    
  2. Run this script:

    #!/bin/bash
    
    read -p 'Please drag and drop the folder which has the PDFs here: ' FOLDER_PATH
    
    cd "$FOLDER_PATH"
    
    for pdf in *.pdf; do
        convert "$pdf" "${pdf%.pdf}.png"
    done
    
    echo "Check the folder. You should have now all the files converted into png"
    
    read -p "Do you want to delete the pdf files [no]? " delete_files
    
    if [[ "$delete_files" =~ ^[yY]+[eE]?[sS]?$ ]]; then
      rm *.pdf
    fi