summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"