With smaller files, ImageMagick tools should work. However, even this is not true because the DPI attribute of a scanned PDF file may not be processed correctly by ImageMagick.
For larger files, ImageMagick is not an option. This is because ImageMagick stores the entire PDF in memory for processing. As a result, using ImageMagick tools does not work for large files.