How to crop pdf using Ghostscript (without entering manually Bounding Box)
问题 I need to crop a pdf-file to its Bounding Box. First I calculate actual Bounding Box: gswin64c.exe ^ -o nul ^ -sDEVICE=bbox ^ input.pdf the result %% HiResBoundingBox: 156.350019 391.521011 445.919963 446.259010 I substitute into the gswin64c.exe ^ -o output.pdf ^ -sDEVICE=pdfwrite ^ -dUseCropBox=true ^ -c "[/CropBox [156.350019 391.521011 445.919963 446.259010] /PAGES pdfmark" ^ -f input.pdf is there a way to substitute the Bounding Box automatically? thank you. 回答1: What you need is called