I have page_1.pnm, …, page_6.pnm, which represent 6 pages of a scanned document, all in gray PNM produced by scanimage and manually postprocessed with GIMP. The command
convert $(for i in 1 2 3 4 5 6; do echo page_$i.pnm; done | xargs echo) -compress Zip -quality 100 document.hi-res.pdf produced a PDF file of size 15620554 bytes, whereas
tar cvf document.hi-res.tar $(for i in $(seq 1 6); do echo page_$i.pnm; done| xargs echo) xz -9 -e -vv document.hi-res.tar produced a .tar.xz file of size 12385312 bytes, which is about 72 % of the PDF size. This means that there is enough superfluous information in the document that the PDF+Zip combination doesn't or can't remove.
This raises the question: Is there a document format (for scanned stuff) for which Windows has a built-in viewer and Debian Linux has at least a standard, freely available viewer such that the documents in this format are generally smaller than PDFs without losing information? (Yes, I tried TIFF, and it was larger than PDF. I also produced a Postscript document with convert and then squeezed it via gzip --best, but the resulting .ps.gz file was even larger. I don't know how to produce usable DJVU documents from gray images in a lossless way. I don't know how to produce XPS files on Debian - GhostXPS/GhostPDL seems to have no package.)
By the way, is there any shorter and more elegant way to produce
page_1.pnm page_2.pnm page_3.pnm page_4.pnm page_5.pnm file_6.pnm than
$(for i in $(seq 1 6); do echo page_$i.pnm; done | xargs echo) PS. I don't need lossy compression; if I allow myself to lose information, I'm pretty happy with
convert $(for i in $(seq 1 6); do echo page_$i.pnm; done | xargs echo) -compress JPEG2000 -quality 40 document.JPEG2000.40.pdf (replace 40 with your choice until your file is small enough for your application).
PPS. As opposed to In ImageMagick, how to create a PDF file from an image with the best Flate compression ratio?, in this question we are NOT (or at least not necessarily) interested in the best compression ratio for a single-page PDF+Zip but allow for many pages and a wider variety of compressors and formats.