Git Product home page Git Product logo

pdf-generator-service's Introduction

generate-pdf

Performance issues with PNG image files

  • GhostScript is used to convert PDF to PDF/A format but but has a bug that results in slow conversion, poor rendering and large resulting files.
  • using gif format files instead of png avoids this issue

Using the Service

Please read this page if you would like to consume this service on MDTP

Endpoint URLs

POST /pdf-generator-service/pdf-generator/generate

Service Definitions

All requests use the HTTP POST method

PDF Generator Service

Functionality

* Generates a PDF based on the submitted html
* Generated PDF must be PDF/A 1 or PDF/A 2 compliant
* Generated PDF must match the HTML page from which it was generated

Request

* html-www-urlencoded-form with a single field 'html' that contains the html to be converted

Response

* HTTP 200 OK with a generated and downloadable PDF
* HTTP 400 Bad Request for invalid/error scenarios

Run the application locally

To run the application execute

sbt ~run 9852

The endpoints can then be accessed with the base url http://localhost:9000/pdf-generator-service/pdf-generator/generate

Tips on installing application on Ubuntu

This command will install ghostscript:

sudo apt-get install ghostscript

This command will install wkhtmltopdf:

sudo apt-get install wkhtmltopdf

We then need to add this symbolic link so that the service finds the program:

sudo ln -s /usr/bin/wkhtmltopdf /usr/local/bin

If you need to check the logs of the generator service, you may find it useful to use this command to remove the graphite warnings:

sm --start PDF_GENERATOR_SERVICE --appendArgs '{"PDF_GENERATOR_SERVICE":["-Dmicroservice.metrics.graphite.enabled=false"]}' -f

This command will bring up the logs of the pdf-generator-service:

sm --logs PDF_GENERATOR_SERVICE

License

This code is open source software licensed under the Apache 2.0 License

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.