Code Monkey home page Code Monkey logo

athenapdf's Introduction

Athena

Build Status License

Live Demo / Screenshots

Simple, Docker-powered PDF conversions.

Athena is comprised of an Electron command line interface (CLI) tool, and a Go microservice for converting HTML to PDF documents.

Athena transformed Arachne into a spider for challenging her as a weaver and/or weaving a tapestry that insulted the gods.

Examples:

When aggressive mode is enabled, only the essential contents of a page are kept in the generated PDF document. It is a clutter-free version of the web page, perfect for reading.

Background

Athena is an open source project.

It was designed to do one thing and to do it well - PDF conversions; to work together with other programs; and to be able to handle text streams, because that is a universal interface.

It aims to give users an on-demand capability to convert HTML to PDF without frills.

At the lowest level, its CLI component (athenapdf) was designed to be an alternative / drop-in replacement for wkhtmltopdf, a popular CLI tool for HTML to PDF conversions. Because of Docker the CLI syntax is a bit more complex but it's much more reliable.

(For what it's worth, wkhtmltopdf is great, but it has a horrible habit of crashing unexpectedly - especially when printing documents with invalid HTML, problematic CSS or other issues).

There is also a microservice component (weaver), allowing you to leverage Athena over HTTP.

Getting Started

CLI vs Microservice

Our CLI tool will suffice for most simple, and everyday HTML to PDF conversions.

However, for conversions at scale / PDF conversion as a service, we recommend getting started with our microservice component instead.

CLI vs Microservice

The microservice is packaged with athenapdf, and you can run both components independently.

Docker

Both components are packaged, and distributed as Docker images.

The only dependency you will need is Docker, and the rest will be handled for you (even if you are running in an environment without a display server - headless environment).

Quick Start

Before starting, ensure your Docker environment is set up, and ready-to-use.

For OSX / Windows users, ensure your Docker Machine is prepared, and the appropriate environment variables are established.

CLI

asciicast

  1. docker pull arachnysdocker/athenapdf
  2. docker run --rm -v $(pwd):/converted/ arachnysdocker/athenapdf athenapdf <input_path> [output_path]
  3. See cli for full documentation

The [output_path] can be omitted.

Example: docker run --rm -v $(pwd):/converted/ arachnysdocker/athenapdf athenapdf http://blog.arachnys.com/

Microservice

asciicast

  1. docker pull arachnysdocker/athenapdf-service
  2. docker run -p 8080:8080 --rm arachnysdocker/athenapdf-service
  3. Inline conversion: http://<docker-address>:8080/convert?auth=arachnys-weaver&url=http://blog.arachnys.com/
  4. OR cURL, and redirect output to file: curl http://dockerhost:8080/convert\?auth\=arachnys-weaver\&url\=http://blog.arachnys.com/ |> out.pdf
  5. See weaver for full documentation

The default authentication key is arachnys-weaver. This can be changed through the WEAVER_AUTH_KEY environment variable.

The microservice can be deployed scalably to ECS if you want to build your own conversion farm.

License

Please note athenapdf is NEITHER affiliated with NOR endorsed by Google Inc. and GitHub Inc.

See LICENSE.


Arachnys

An Arachnys Christmas project.

athenapdf's People

Contributors

dbuxton avatar dfc avatar gotenxiao avatar hazzadous avatar jeanfred avatar mrsaints avatar

Watchers

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