GithubHelp home page GithubHelp logo

harimayco / pdfcomprezzor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from henrixapp/pdfcomprezzor

0.0 1.0 0.0 7.19 MB

Compress pdfs in browser, using pdfcpu.io

HTML 0.66% Go 12.99% JavaScript 84.73% Dockerfile 1.63%

pdfcomprezzor's Introduction

pdfcomprezzor

Simple Wasm-Program to compress pdffiles with pictures in browser, based on pdfcpu. The programm replaces all images that are bigger than 1240x1754 are resized to this size and converted to JPG. This is done using pdfcpu. We decode, compress, delete and insert each embedded image. This reuses the object-id of the original object and thus replaces the image.

Build

GOOS=js GOARCH=wasm go build -o pdfcomprezzor.wasm 

Docker

If you want to try this project using docker, run the container by following these steps:

sudo docker build -t dockerized_pdf_comprezzor .
sudo docker run -p 8081:80 dockerized_pdf_comprezzor

Now you can visit localhost:8081 to compress files.

API

using worker.js

See test.js

Running the example

Firstly, you have to copy a version of wasm_exec.js to this project. cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" .

Serve the files with a server, that supports mime-type application/wasm

Navigate to index.html and open a file, wait for compression...

If you select two files or more, they will be merged.

License: Apache 2.0

(c) 2020-2022, Henrik Reinstädtler

pdfcomprezzor's People

Contributors

christian-heusel avatar henrixapp avatar odhier avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.