Skip to content

Latest commit

 

History

History
95 lines (65 loc) · 6.23 KB

pdf-generation-service.md

File metadata and controls

95 lines (65 loc) · 6.23 KB
description
Configure bulk generation of PDF documents

PDF Generation Service

Overview

The objective of the PDF generation service is to bulk generate pdf as per requirement.

Pre-requisites

Before proceeding with the documentation, ensure the following prerequisites are met:

  1. Install npm
  2. Ensure the Kafka server is operational
  3. Confirm that the egov-persister service is running and configured with a pdf generation persister path
  4. Verify that the PostgreSQL (PSQL) server is running, and a database is created to store filestore IDs and job IDs of generated PDFs

Key Functionalities

  • Provide a common framework to generate PDFs
  • Provide flexibility to customise the PDF as per the requirement
  • Provide functionality to add an image or QR code in a PDF
  • Provide functionality to generate PDFs in bulk
  • Provide functionality to specify the maximum number of records to be written in one PDF
Environment Variables Description
MAX_NUMBER_PAGES Maximum number of records to be written in one PDF
DATE_TIMEZONE Date timezone which will be used to convert epoch timestamp into date (DD/MM/YYYY)
DEFAULT_LOCALISATION_LOCALE Default value of localisation locale
DEFAULT_LOCALISATION_TENANT Default value of localisation tenant
DATA_CONFIG_URLS File path/URL'S of data config
FORMAT_CONFIG_URLS File path/URL'S of format config

External libraries used :

Interaction Diagram

Deployment Details

  1. Create data config and format config for a PDF according to product requirements.
  2. Add data config and format config files in PDF configuration.
  3. Add the file path of data and format config in the environment yaml file.
  4. Deploy the latest version of pdf-service in a particular environment.

Configuration Details

For configuration details, refer to Customizing PDF Receipts & Certificates.

Integration Details

Integration Scope

The PDF configuration can be used by any module which needs to show particular information in PDF format that can be printed/downloaded by the user.

Integration Benefits

  • Functionality to generate PDFs in bulk.
  • Avoid regeneration.
  • Support QR codes and Images.
  • Functionality to specify the maximum number of records to be written in one PDF.
  • Uploading generated PDF to filestore and return filestore id for easy access.

Integration Steps

To download and print the required PDF _create API has to be called with the required key (For Integration with UI, please refer to the links in Reference Docs)

Reference Docs

Doc Links

Title
Customizing PDF Receipts & Certificates
Steps for Integration of PDF in UI for download and print PDF
API Swagger Documentation

API List

Title
pdf-service/v1/_create
pdf-service/v1/_createnosave
pdf-service/v1/_search

{% hint style="info" %} Note: All the APIs are in the same Postman collection, therefore, the same link is added in each row. {% endhint %}