From 176cb9ab032c5691f683b213500060e0d6c4bb8a Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Mon, 16 May 2022 21:49:57 +0200 Subject: [PATCH] Added notes about ghostscript to the KB --- knowledge base/ghostscript.md | 42 +++++++++++++++++++++++++++++++++++ knowledge base/mac os x.md | 9 +++----- 2 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 knowledge base/ghostscript.md diff --git a/knowledge base/ghostscript.md b/knowledge base/ghostscript.md new file mode 100644 index 0000000..8b3aa04 --- /dev/null +++ b/knowledge base/ghostscript.md @@ -0,0 +1,42 @@ +# Ghostscript + +## TL;DR + +```sh +# Install. +brew install ghostscript +sudo port install ghostscript + +# Reduce the size of PDF files. +gs -dNOPAUSE -dQUIET -dBATCH \ + -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.4 \ + -sOutputFile=path/to/small/file.pdf \ + path/to/massive/file.pdf +``` + +## Reduce the size of PDF files + +Execute the following: + +```sh +gs -dNOPAUSE -dQUIET -dBATCH \ + -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.4 \ + -sOutputFile=path/to/small/file.pdf \ + path/to/massive/file.pdf +``` + +Use one of the following options for the value of `-dPDFSETTINGS`: + +| Value | Description | +| ----------- | ---------------------------------------------- | +| `/screen` | Screen-view-only quality, 72 dpi images | +| `/ebook` | Low quality, 150 dpi images | +| `/printer` | High quality, 300 dpi images | +| `/prepress` | High quality, color preserving, 300 dpi images | +| `/default` | Almost identical to `/screen` | + +## Sources + +- [Reducing PDF File size] + +[reducing pdf file size]: https://superuser.com/questions/293856/reducing-pdf-file-size#1217306 diff --git a/knowledge base/mac os x.md b/knowledge base/mac os x.md index 8a0416c..b947ebe 100644 --- a/knowledge base/mac os x.md +++ b/knowledge base/mac os x.md @@ -143,13 +143,10 @@ defaults write com.apple.finder AppleShowAllFiles TRUE ## Resize an image from CLI -Note: - -* edits the input image -* `-Z` retains ratio - ```sh -sips -Z 1000 Downloads/IMG_20190527_013903.jpg +# Retain ratio. +# Save as different file. +sips -Z 1000 -o resized.jpg IMG_20190527_013903.jpg ``` ## Boot keys cheatsheet