convert scan.png -quality 50 scan.jpg
You can add ''-level 10%,80%'' to make black more black and background less gray.
Finally use:
convert scan.jpg scan.pdf
to convert your scan to a pdf. You can give ''convert'' multiple JPGs to create a multi paged PDF.