summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2022-12-11 20:52:12 +0100
committerJonas Smedegaard <dr@jones.dk>2022-12-11 20:52:12 +0100
commit82ccc96de73b8118d488fa48bf03850adf543bd9 (patch)
tree04def5bcc759738c46d83548b7286fae8fce199f
parentb36f8331a0eabd4e2d3923174645d419e2086130 (diff)
fix reorder arguments to ensure command overrides code in file
-rw-r--r--USE.md11
1 files changed, 6 insertions, 5 deletions
diff --git a/USE.md b/USE.md
index 89f1b69..1af417b 100644
--- a/USE.md
+++ b/USE.md
@@ -154,15 +154,16 @@ resizing from A4 to printable-area-A4
(i.e. a dumb printer always auto-resizing to fit):
gs -o output.pdf -sDEVICE=pdfwrite -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842 -dFIXEDMEDIA -dCompatibilityLevel=1.4 \
- -c "<</EndPage {0 eq {[/CropBox [0 0 567 802] /PAGE pdfmark true}{false}ifelse}>> setpagedevice" -f input.pdf
+ -f input.pdf -c "<</EndPage {0 eq {[/CropBox [0 0 567 802] /PAGE pdfmark true}{false}ifelse}>> setpagedevice"
+
+NB! It is important to list option `-f` before `-c`,
+to ensure that any `CropBox` marks in file is [overridden] by the command.
TODO: maybe options `-dDEVICEWIDTHPOINTS` and `-dDEVICEHEIGHTPOINTS` are superfluous
TODO: maybe options `-dDEVICEWIDTHPOINTS` and `-dDEVICEHEIGHTPOINTS` can be shortened as `-dDEVICEWIDTH` and `-dDEVICEHEIGHT`
-TODO: maybe works only with `CropMark` applied for whole PDF file (and when none are applied?) but [fails] when input file already contain per-page `CropMark` hints
-
Source: <https://stackoverflow.com/a/26989410>
-[fails]: <https://stackoverflow.com/a/6184547/18619283>
- "stackoverflow answer mentioning need for mangling existing /CropMark annotations"
+[overridden]: <https://stackoverflow.com/a/59608992>
+ "stackoverflow answer mentioning importance of Ghostscript argument order"