Skip to content

Instantly share code, notes, and snippets.

View mahi008's full-sized avatar
👑
Busy fixing stuff !

Mahinthan Kengatharan mahi008

👑
Busy fixing stuff !
View GitHub Profile
@mahi008
mahi008 / git_autocommit_all.bat
Created September 25, 2019 13:34 — forked from ethaizone/git_autocommit_all.bat
Commit git with bat file
@echo off
echo type "commit" or "update"
cd "curl"
set GIT_PATH="C:\Program Files (x86)\Git\bin\git.exe"
set BRANCH = "origin"
:P
set ACTION=
set /P ACTION=Action: %=%
@mahi008
mahi008 / compress_pdf.md
Created July 31, 2019 08:55 — forked from ahmed-musallam/compress_pdf.md
How to compress PDF with ghostscript

How to compress PDF using ghostscript

As a developer, it bothers me when someone sends me a large pdf file compared to the number of pages. Recently, I recieved a 12MB scanned document for just one letter-sized page... so I got to googlin, like I usually do, and found ghostscript!

to learn more abot ghostscript (gs): https://www.ghostscript.com/

What we are interested in, is the gs command line tool, which provides many options for manipulating PDF, but we are interested in compressign those large PDF's into small yet legible documents.

credit goes to this answer on askubuntu forum: https://askubuntu.com/questions/3382/reduce-filesize-of-a-scanned-pdf/3387#3387?newreg=bceddef8bc334e5b88bbfd17a6e7c4f9

@mahi008
mahi008 / compress-pdf-with-gs.md
Created July 31, 2019 08:38 — forked from guifromrio/compress-pdf-with-gs.md
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.