Sign inSign up

thebinij/pdf-compressor

By thebinij

Updated about 3 years ago

Golang based PDF compress which uses Ghostscript to compress PDF

Image
0

607

thebinij/pdf-compressor repository overview

Build and run using docker

docker pull thebinij/pdf-compressor:latest         
docker run -p 8080:8080 thebinij/pdf-compressor:latest

API Endpoints:

GET /ping

Description: This endpoint returns a simple "pong!" response to check if the server is up and running.
Endpoint URL: http://localhost:8080/ping
Response: pong!

curl -X GET http://localhost:8080/ping
Pong!
POST /compress-pdf

Description: This endpoint accepts a PDF file as a form data field named pdfFile and compresses the PDF while preserving its content and quality.
Endpoint URL: http://localhost:8080/compress-pdf
Request Body: Multipart form data with the following fields:

  • pdf_file (required): The PDF file to be compressed.
  • dpi (optional): The DPI (dots per inch) value for the compression (e.g., 90).
  • grayscale (optional): Set to true to convert the PDF to grayscale.

Response: The compressed PDF file will be returned as a download.

curl -X POST -F "[email protected]" -F "dpi=90" -F "grayscale=true" http://localhost:8080/compress-pdf --output compressed_example.pdf

Tag summary

Content type

Image

Digest

sha256:fe1d74e64

Size

32 MB

Last updated

about 3 years ago

docker pull thebinij/pdf-compressor