summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2021-07-07 16:24:07 +0200
committerJonas Smedegaard <dr@jones.dk>2021-07-07 16:27:07 +0200
commita6c71bc82545959ead35190fce268710acf07f46 (patch)
treecf5ed4b182e4006314a63719ae78afc5d97dd4eb
parent70a7ba928a470f238838cd495a77b4e2cec049dc (diff)
explain the magic width and height values in resize command
-rw-r--r--USE.md14
1 files changed, 13 insertions, 1 deletions
diff --git a/USE.md b/USE.md
index f4facae..bdd3993 100644
--- a/USE.md
+++ b/USE.md
@@ -16,5 +16,17 @@ Alternative:
## Resize PDF with crop marks
-A3 oversize to A4 oversize:
+Ghostscript resizing is done by first defining target size
+and then tell to resize content to fit that target with `FitPage`.
+
+For a PDF document containing bleed and/or crop marks,
+setting a simple target `PAPERSIZE` would either scale too much
+or (e.g. with `-dUseArtBox`) would loose bleed and crop marks.
+Instead we look up original width and height with the command `pdfinfo`
+and explicitly set those values scaled down by 21/29.7
+(the ratio between A3 and A4 page formats).
+
+Example command,
+for a PDF document with width 910.24 and height 1258.9:
+
gs -o output.pdf -sDEVICE=pdfwrite -dDEVICEWIDTHPOINTS=643.60333 -dDEVICEHEIGHTPOINTS=890.131 -dFIXEDMEDIA -dFitPage -dCompatibilityLevel=1.4 input.pdf