Coder Social home page Coder Social logo

cheesyd's Introduction

cheesyd

Daemon to convert HTML to PDF using the mighty wkhtmltopdf C bindings.

Status

It is not a work completed yet but it actually can prove that the idea is valid already. It does the happy path in an elementary way and a few error ones too. So far so good.

Why?

I've being working with wkhtmltopdf for almost 2 years now in my daily job and lately I got very interested in its C bindings, spending many of my spare time digging into its source code and writing a few pet codes in Go and C instead of being out drinking beer and stuff. I mean, I mean...

Well, anyway, I thought the progression is to write some half decent code and put it out there. So that's why.

Dependencies & running env

If you look at the Dockerfile you're gonna see that it depends on debian-wkhtmltopdf. No worries, I did it and you can get here.

Get and run it now

git clone https://github.com/leandrosilva/cheesyd.git
cd cheesyd
docker build -f Dockerfile -t cheesyd .
docker run -it -v $PWD:/source_code --name cheesyd_test cheesyd
cheesyd

Or you can build and run it on your own host machine, by typing from cheesy directory:

make build
make run

Now it's gonna connect to redis on localhost:6379 and dequeue jobs from cheesyd:queue:job_request, whose which should provide request data on cheesyd:job:{job_id} hash as:

payload = {"page":"sample1.html", "windowStatus":"ready"}
status  = request

When it get the job done, it's gonna put the result on the same job hash as:

result = <base64 encoded PDF content>
status = done

There you go.

cheesyd's People

Contributors

leandrosilva avatar

Watchers

 avatar James Cloos 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.