# PDF operations ## Merge gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf GhostScript uses some algorithm to autodetect page orientation, and may undersireably flip some pages. To disable this, add: "-dAutoRotatePages=/None" ## Compress gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile=output.pdf input.pdf ## Extract pages pdfjam --outfile out.pdf in.pdf 1,3,4-7 `--landscape` to set orientation of output pages. `--angle ` to rotate (counter clockwise). ## Images to pdf convert in1.jpg in2.jpg out.pdf ## DjVu to pdf ddjvu -format=pdf file.fjvu file.pdf * `-quality=85`: can be used to produce smaller output * `-quality=uncompressed`: disable compression * `-page=23-48,59`: select pages to convert * `-verbose` * `-eachpage`: generates a separate file per page