Imagine I have a bunch of JPEG files that I have scanned using a known resolution (300 dpi in this case). However the JPEG file has some additional margin at the border because the scanner's area is larger than the A4 paper.
The resulting PDF should have the same geometry as the original paper was: Din A4 (210mm x 297mm).
A possible compression would be necessary as well...
Just an idea was the following (not working). You might ignore this and post a command that fulfils my needs which is suitable for my aim
convert \ Scan_20181221205531.jpg \ -units PixelsPerInch \ -density 300 \ -format pdf \ -compress jpeg \ -quality 70 \ -page a4 \ out.pdf convert: not authorized `out.pdf' @ error/constitute.c/WriteImage/1028.