Skip to content

Instantly share code, notes, and snippets.

@yuwash
Created January 6, 2018 16:52
Show Gist options
  • Save yuwash/57e9e73c016ceb6726e0b6cbb37bd091 to your computer and use it in GitHub Desktop.
Save yuwash/57e9e73c016ceb6726e0b6cbb37bd091 to your computer and use it in GitHub Desktop.
Die Elektroreturn-Versandmarke papiersparend viermal auf einer Seite ausdrucken
#! /usr/bin/env bash
ETIKETT_PDF="dp-electroreturn_versandetikett.pdf"
OUT_PDF="${ETIKETT_PDF%.pdf}-multiplied.ps"
if ! [[ -e "$ETIKETT_PDF" ]]; then
echo please download it from https://www.deutschepost.de/de/e/electroreturn.html
else
pdftops "$ETIKETT_PDF" \
&& pstops "0R(0,.5h)+0R(.5w,.5h)+0L(1w,.5h)+0L(.5w,.5h)" "${ETIKETT_PDF%.pdf}.ps" "${OUT_PDF%.pdf}.ps" \
&& ps2pdf "${OUT_PDF%.pdf}.ps" \
&& echo generated "$OUT_PDF"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment