Skip to content

Instantly share code, notes, and snippets.

@fabienhinault
Last active September 13, 2016 19:28
Show Gist options
  • Save fabienhinault/da25baae45b201d7e78673b4094ec506 to your computer and use it in GitHub Desktop.
Save fabienhinault/da25baae45b201d7e78673b4094ec506 to your computer and use it in GitHub Desktop.
Attempts to crop a pdf file in order to simulate a scale
gs -o cropped.pdf -sDEVICE=pdfwrite -dDEVICEWIDTHPOINTS=595.32
gs -o cropped.pdf -sDEVICE=pdfwrite -dDEVICEWIDTHPOINTS=595.32 -dDEVICEHEIGHTPOINTS=421 -dFIXEDMEDIA -c " 0 0 595.32 421 rectclip" -f final.pdf
gs -o cropped2.pdf -sDEVICE=pdfwrite -dDEVICEWIDTHPOINTS=595.32 -dDEVICEHEIGHTPOINTS=421 -dFIXEDMEDIA -c " 0 421 translate" -c " 0 0 595.32 421 rectclip" -f final.pdf
gs -o cropped2.pdf -sDEVICE=pdfwrite -dDEVICEWIDTHPOINTS=595.32 -dDEVICEHEIGHTPOINTS=421 -dFIXEDMEDIA -c " 0 421 595.32 842 rectclip" -f final.pdf
gs -o cropped2.pdf -sDEVICE=pdfwrite -dDEVICEWIDTHPOINTS=595.32 -dDEVICEHEIGHTPOINTS=421 -dFIXEDMEDIA -c " 0 421 translate" -c " 0 421 595.32 842 rectclip" -f final.pdf
gs -o cropped2.pdf -sDEVICE=pdfwrite -c " 0 421 translate" -c " 0 421 595.32 842 rectclip" -f final.pdf
gs -o cropped2.pdf -sDEVICE=pdfwrite -c " 0 421 translate" -c " 0 0 595.32 421 rectclip" -f final.pdf
gs -o cropped2.pdf -sDEVICE=pdfwrite -c " 0 0 595.32 421 rectclip" -f final.pdf
gs -o cropped2.pdf -sDEVICE=pdfwrite -c "[/CropBox [0 421 595.32 842]" -c " /PAGES pdfmark" -f final.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment