Giter Club home page Giter Club logo

hmcts.rpe-pdf-service's Introduction

PDF service

codecov

This is a PDF service which allows to generate read-only PDFs based on given template in HTML/Twig format and placeholder data in JSON format. The service provides a single RESTful endpoint that merges both template and placeholder data together and returns the PDF as a binary stream.

The template, besides containing ordinary HTML markup, can also contain inline CSS styling and embedded images.

Getting started

Prerequisites

diagram

Building

The project uses Gradle as a build tool but you don't have to install it locally since there is a ./gradlew wrapper script.

To build project please execute the following command:

    ./gradlew build

Running

First you need to create distribution by executing following command:

    ./gradlew installDist

When the distribution has been created in build/install/pdf-service directory, you can run the application by executing following command:

    docker-compose up

As a result the following container(s) will get created and started:

  • long living container for API application exposing port 5500

API documentation

API documentation is provided with Swagger:

  • http://localhost:5500/swagger-ui.html - UI to interact with the API resources

NOTE: Swagger scans classes in the uk.gov.hmcts.reform.pdfservice.controllers package.

Consuming

There is a client library provided for java https://github.com/hmcts/cmc-pdf-service-client

Docker

Image is available in the HMCTS azure container registry (currently private) @ hmcts.azurecr.io/hmcts/rpe/pdf-service. See usage example in: docker-compose.yml

Non ASCII Characters Support

To render PDF with non ASCII characters, please use the 'Open Sans' font-family.

font-family: 'Open Sans';

Example:

<head>
   <style>
      html {
      font-family: 'Open Sans';
      }
   </style>
</head>

Developing

Unit tests

To run all unit tests please execute following command:

    ./gradlew test

Coding style tests

To run all checks (including unit tests) please execute following command:

    ./gradlew check

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Standard API

We follow RESTful API standards.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

hmcts.rpe-pdf-service's People

Contributors

adusumillipraveen avatar banderous avatar constantinpr avatar damiandunajski avatar dependabot-preview[bot] avatar dependabot[bot] avatar doncem avatar hannah38 avatar jacmurphy avatar karoljastrzebski avatar klawani avatar lgonczar avatar luigibk avatar markry-kainos avatar naikajah avatar renovate[bot] avatar rhollins avatar rkondratowicz avatar rlewan avatar ruban72 avatar timja avatar timwebster9 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.