Skip to main content
Home
GrN.dk

Main navigation

  • Articles
  • Cases
  • Services
  • Your Digital Project Manager
  • About Greg Nowak
  • Image Gallery
  • Contact
User account menu
  • Log in

Join my community / free newsletter — sign up here

Breadcrumb

  1. Home

Shrink PDF In Linux

Illustrated infographic summarizing: Shrink PDF In Linux

Here is a great reference how to compress and reduce the size of PDF files with Ghost Scrip (gs) in Linux: http://blog.virtualzone.de/2012/11/how-to-reduce-pdf-file-size-in-linux…

Example: "gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile=output.pdf input.pdf"

Fill white: convert -density 70 input.pdf -channel rgba -alpha set -fill white -opaque 'rgb(255,200,195)' -opaque 'rgb(255,253,177)' -opaque '
rgb(255,155,240)' -opaque 'rgb(255,91,193)' -colorspace gray OUTPUT-convert.pdf

Fix error: convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/421.

Edit: /etc/ImageMagick-7/policy.xml or -6: <policy domain="coder" rights="read | write" pattern="PDF" /> (https://stackoverflow.com/questions/52998331/imagemagick-security-polic…)

Split PDF

(http://linuxcommando.blogspot.com/2013/02/splitting-up-is-easy-for-pdf-…)

Example: "pdftk myoldfile.pdf cat 1 2 4 5 output mynewfile.pdf"

Example 2: "mkdir output; pdftk * output/output.pdf"

Merge PDF

pdftk input-file-1.pdf input-file-2.pdf cat output output.pdf

images: convert * output.pdf (remember to set policy:  sudo nano /etc/ImageMagick-6/policy.xml)

Edit PDF

You can edit PDF files in libre office draw or in harder cases you might try Master PDF Editor (https://code-industry.net/free-pdf-editor/).

Last modified
2026-08-12

Tags

  • Linux
  • Data
  • Log in to post comments
Attachment
shrinkpdf_0.txt (3.09 KB)

Review Greg on Google

Greg Nowak Google Reviews

 

Written recommendations from Trafik og Veje, Aarhus Municipality (2011) and AgroTech (2010) — read them on LinkedIn.

Illustrated infographic summarizing: WordPress 7.1 Forces the Editor Into an iframe—Test Your Custom Blocks
WordPress 7.1 Forces the Editor Into an iframe—Test Your Custom Blocks
2026-08-15

WordPress 7.1 removes the non-iframe editor fallback. Learn how to audit custom blocks, test real workflows and fix compatibility issues before launch.

Illustrated infographic summarizing: GitHub will stop sending jobs to stale self-hosted runners
GitHub will stop sending jobs to stale self-hosted runners
2026-08-14

GitHub starts enforcing runner versions on August 24, 2026. Audit and upgrade self-hosted runners before builds and deployments start stalling.

Illustrated infographic summarizing: Your AI Agent Has Shell Access. What Can It Reach?
Your AI Agent Has Shell Access. What Can It Reach?
2026-08-13

A practical guide to mapping what a shell-enabled AI agent can reach, then containing its access to files, credentials, networks, tools, and high-impact actions.

Illustrated infographic summarizing: Cloudflare Changed DoH JSON. What Else Is Parsing DNS as Text?
Cloudflare Changed DoH JSON. What Else Is Parsing DNS as Text?
2026-08-12

Cloudflare’s DoH JSON change exposes brittle DNS parsing. Find affected scripts, test both formats, and choose a safer integration contract.

Illustrated infographic summarizing: Your Website Can Answer Questions Now. Should It?
Your Website Can Answer Questions Now. Should It?
2026-08-11

NLWeb makes conversational website search practical to deploy. The real question is whether your content, users and team are ready to support it.

Illustrated infographic summarizing: AI Search Finally Has Reports. Now Connect Visibility to Revenue
AI Search Finally Has Reports. Now Connect Visibility to Revenue
2026-08-11

Google and Bing now expose first-party AI search data. The real task is connecting citations and impressions to analytics, CRM outcomes, and revenue.

Illustrated infographic summarizing: The Bot Passed Your CAPTCHA. What Did It Do Next?
The Bot Passed Your CAPTCHA. What Did It Do Next?
2026-08-11

Passing a challenge is only one signal. Session analysis, server-side validation and endpoint-specific controls help reduce bot abuse without blocking customers.

Illustrated infographic summarizing: WordPress 7.1 Moves Image Work Into the Browser—Test Every Media Hook
WordPress 7.1 Moves Image Work Into the Browser—Test Every Media Hook
2026-08-11

WordPress 7.1 shifts image processing into supported browsers. Here is what to test across hooks, CDNs, formats, security headers, and fallbacks.

Illustrated infographic summarizing: Prompt Caches Have Write Costs Now—Audit What Your Workflow Reuses
Prompt Caches Have Write Costs Now—Audit What Your Workflow Reuses
2026-08-10

GPT-5.6 makes cache writes billable. See how to spot wasted writes, stabilise prompt prefixes, place breakpoints and measure whether caching pays.

Illustrated infographic summarizing: The AI Crawler in Your Logs May Be Wearing a Borrowed Name
The AI Crawler in Your Logs May Be Wearing a Borrowed Name
2026-08-09

A User-Agent is a claim, not proof. See how to verify AI crawler traffic before it shapes reporting, robots.txt decisions, or WAF exceptions.

More articles
RSS feed

Footer

  • All articles
  • Contact

GrN.dk — AI automation, web platforms, web optimization, data handling and logistics.

© 2026 GrN.dk · LinkedIn · Contact · AI automation in Danish: nowa.dk

Behind GrN.dk: Individual Entrepreneur Codecrafter · Tax ID 305669096 · Bakhtrioni St. 22, 0194 Tbilisi, Georgia · official business register