Giter Site home page Giter Site logo

pdf-generator's Introduction

PDF-report generator in Rust

It is built in Rust using the following crates:

  1. Rocket framework as HTTP Server
  2. Handlebars-rust as template engine
  3. wkhtmltopdf command line tool to generate PDF (not a crate)
  4. Utilities: log, rust-ini, uuid

Application workflow is an synchronous call over HTTP and looks like this:

HTTP Route -> Service -> Template Engine -> wkhtmltopdf - PDF

See report template in templates/book-order-report.html.

Sample JSON request looks like this:

{
  "template_name": "book-order-report",
  "user_params": {
    "customer_name": "Frank Smith",
    "address": "Address: Frankfurt am Main, Mainzer str. 100",
    "ordered_books": [
      {
        "book_name": "Getting Things Done: The Art of Stress-Free Productivity. Authors: David Allen",
        "amount": 9.51
      },
      {
        "book_name": "Funky Business - Talent Makes Capital Dance. Authors: Ridderstråle, Nordström",
        "amount": 14.99
      },
      {
        "book_name": "The Rust Programming Language (Manga Guide). Authors: Klabnik, Nichols",
        "amount": 23.99
      }
    ],
    "total": 48.49
  }
}

See more details at this INNOQ article: https://www.innoq.com/de/blog/rust-report-generator/

pdf-generator's People

Contributors

keysym avatar novakov-alexey 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.