diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2026-09-27 12:37:52 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2026-09-27 12:37:52 +0200 |
| commit | badf7aba844967c5d13e01079c12df758715167a (patch) | |
| tree | 3c0872b667a64a82caf7bab3d2503c9f7a6444b9 /accounts/gkleen@skadhi/utils/pdf2pdf.nix | |
| parent | 74d97f767ac4d6f05ce95e388460a49c5190afc3 (diff) | |
| download | nixos-flakes.tar nixos-flakes.tar.gz nixos-flakes.tar.bz2 nixos-flakes.tar.xz nixos-flakes.zip | |
...flakes
Diffstat (limited to 'accounts/gkleen@skadhi/utils/pdf2pdf.nix')
| -rw-r--r-- | accounts/gkleen@skadhi/utils/pdf2pdf.nix | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/accounts/gkleen@skadhi/utils/pdf2pdf.nix b/accounts/gkleen@skadhi/utils/pdf2pdf.nix new file mode 100644 index 00000000..7305a201 --- /dev/null +++ b/accounts/gkleen@skadhi/utils/pdf2pdf.nix | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | pkgs@{ lib, resholve, zsh, ghostscript_headless, ... }: | ||
| 2 | |||
| 3 | resholve.writeScriptBin "pdf2pdf" { | ||
| 4 | inputs = with pkgs; [ghostscript_headless]; | ||
| 5 | interpreter = lib.getExe zsh; | ||
| 6 | } '' | ||
| 7 | exec gs -dPDFSETTINGS=/prepress -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dSAFER -dPreserveAnnots=false "-sOutputFile=''${2:-''${1:r}_pdf2pdf.pdf}" "''${1}" | ||
| 8 | '' | ||
