DIGIT Core
PlatformDomainsAcademyDesign SystemFeedback
2.8
2.8
  • ☑️Introducing DIGIT Platform
    • DIGIT - Value Proposition
  • Platform
    • 🔎Overview
      • Principles
      • Architecture
        • Service Architecture
        • Infrastructure Architecture
        • Deployment Architecture
      • Technology
        • API Gateway
        • Open Source Tools
      • Checklists
        • API Checklist
        • Security Checklist
          • Security Guidelines Handbook
          • Security Flow - Exemplar
        • Performance Checklist
        • Deployment Checklist
      • UI Frameworks
        • React UI Framework
    • 🔧Core Services
      • Workflow Service
        • Setting Up Workflows
        • Configuring Workflows For An Entity
        • Workflow Auto Escalation
        • Migration To Workflow 2.0
      • Location Services
      • User Services
      • Access Control Services
      • PDF Generation Service
      • MDMS (Master Data Management Service)
        • Setting up Master Data
          • MDMS Overview
          • MDMS Rewritten
          • Configuring Tenants
          • Configuring Master Data
          • Adding New Master
          • State Level Vs City Level Master
      • Payment Gateway Service
      • User Session Management
      • Indexer Service
        • Indexer Configuration
      • URL Shortening Service
      • XState Core Chatbot
        • Xstate-Chatbot Message Localisation
        • XState-Chatbot Integration Document
      • NLP Engine Service
        • NLP Chatbot
      • SMS Template Approval Process
      • Telemetry Service
      • Document Uploader Service
      • Notification Enhancement Based On Different Channel
      • Report Service
        • Configuring New Reports
          • Impact Of Heavy Reports On Platform
          • Types Of Reports Used In Report Service
      • SMS Notification Service
        • Setting Up SMS Gateway
          • Using The Generic GET & POST SMS Gateway Interface
      • Survey Service
      • Persister Service
        • Persister Configuration
      • Encryption Service
        • Encryption Client Library
        • User Data Security Architecture
        • Guidelines for supporting User Privacy in a module
      • FileStore Service
      • ID Generation Service
      • Localization Service
        • Configuring Localization
          • Setup Base Product Localization
          • Configure SMS and Email
      • Email Notification Service
      • Searcher Service
      • Zuul Service
      • User OTP Service
      • OTP Service
      • Chatbot Service
      • National Dashboard Ingest
        • National Dashboard API Performance Testing Specs and Benchmark
        • National Dashboard: Steps for Index Creation
        • National Dashboard Adaptor Service
          • Deployment of Airflow DAG
          • Trigger Airflow DAG
          • Configure Airflow
          • Insert & Delete Data - Steps
          • Important Links & Credentials
          • Code Structure
          • KT Sessions
          • Pre-requisites For Enabling Adaptor
        • Revenue Maximisation
      • Audit Service
        • Signed Audit Performance Testing Results
      • Service Request
      • Self Contained Service Architecture (HLD)
      • Accelerators
        • Inbox Service
    • ✏️API Specifications
      • User
      • Access Control
      • Employee
      • Location
      • Localisation
      • Encryption
      • Indexer
      • File Store
      • Collection
      • DSS Ingest
      • HRMS
      • National Dashboard Ingest
      • WhatsApp Chatbot
      • Master Data Management
      • ID Generation
      • URL Shortner
      • Workflow Service
      • Workflow v2
      • Document Uploader Service
      • OTP Service
      • Reporting Service
      • PDF Generation Service
      • Payment Gateway Service
    • 🔐Data Protection & Privacy
      • Data Protection & Privacy Definitions
      • Legal Obligations For Privacy - eGov
      • Data Protection & Privacy - Global Best Practices
      • Guidelines
        • Platform Owner Guidelines
        • Implementing Agencies Guidelines
        • Admin Guidelines
        • Program Owner Guidelines
        • Data Security and Data Privacy
      • Data Privacy Policy Templates
        • eGov Data Privacy Policy
        • Implementing Agency Privacy Policy
        • Admin & Program Owner Privacy Policy
        • Supporting Agency Privacy Policy
      • Global Standards For All Roles
    • ▶️Get Started
      • Install DIGIT
      • Access DIGIT
      • Sandbox
      • Training and Certification
        • Training Resources
    • ⚒️Integrations
      • Payment
      • Notification
      • Transaction
      • Verification
      • View
      • Calculation
    • 🛣️Roadmap
    • 🎬Open Events
    • 👩‍💻Source Code
    • 👁️Project Plan
    • 📋Discussion Board
    • 🤝Contribute
  • Guides
    • 📓Installation Guide
      • DIGIT Deployment
      • Quick Setup
        • DIGIT Installation on Azure
        • DIGIT Installation on AWS
      • Production Setup
        • AWS
          • 1. Pre-requisites
          • 2. Understanding EKS
          • 3. Setup AWS Account
          • 4. Provisioning Infra Using Terraform
          • 5. Prepare Deployment Config
          • 6. Deploy DIGIT
          • 7. Bootstrap DIGIT
          • 8. Productionize DIGIT
          • FAQ
        • Azure
          • 1. Azure Pre-requisites
          • 2. Understanding AKS
          • 3. Infra-as-code (Terraform)
        • SDC
          • 1. SDC Pre-requisites
          • 2. Infra-as-code (Kubespray)
          • CI/CD Setup On SDC
        • CI/CD Set Up
          • CI/CD Build Job Pipeline Setup
        • Prepare Helm Release Chart
        • Deployment - Key Concepts
          • Security Practices
          • Readiness & Liveness
          • Resource Requests & Limits
          • Deploying DIGIT Services
          • Deployment Architecture
          • Routing Traffic
          • Backbone Deployment
    • 💽Data Setup Guide
      • User Module
      • Localisation Module
      • Location Module
    • 🚥Design Guide
      • Model Requirements
      • Design Services
      • Design User Interface
      • Checklists
    • ⚒️Developer Guide
      • Pre-requisites Training Resources
      • Backend Developer Guide
        • Section 0: Prep
          • Development Pre-requisites
          • Design Inputs
            • High Level Design
            • Low Level Design
          • Development Environment Setup
        • Section 1: Create Project
          • Generate Project Using API Specs
          • Create Database
          • Configure Application Properties
          • Import Core Models
          • Implement Repository Layer
          • Create Validation & Enrichment Layers
          • Implement Service Layer
          • Build The Web Layer
        • Section 2: Integrate Persister & Kafka
          • Add Kafka Configuration
          • Implement Kafka Producer & Consumer
          • Add Persister Configuration
          • Enable Signed Audit
          • Run Application
        • Section 3: Integrate Microservices
          • Integrate IDGen Service
          • Integrate User Service
          • Add MDMS Configuration
          • Integrate MDMS Service
          • Add Workflow Configuration
          • Integrate Workflow Service
          • Integrate URL Shortener Service
        • Section 4: Integrate Billing & Payment
          • Custom Calculator Service
          • Integrate Calculator Service
          • Payment Back Update
        • Section 5: Other Advanced Integrations
          • Add Indexer Configuration
          • Certificate Generation
        • Section 6: Run Final Application
        • Section 7: Build & Deploy Instructions
        • FAQs
      • Flutter UI Developer Guide
        • Introduction to Flutter
          • Flutter - Key Features
          • Flutter Architecture & Approach
          • Flutter Pre-Requisites
        • Setup Development Environment
          • Flutter Installation & Setup Guide
          • Setup Device Emulators/Simulators
          • Run Application
        • Build User Interfaces
          • Create Form Screen
        • Build Deploy & Publish
          • Build & Deploy Flutter Web Application
          • Generate Android APKs & App Bundles
          • Publishing App Bundle To Play Store
        • State Management With Provider & Bloc
          • Provider State Management
          • BloC State Management
        • Best Practices & Tips
        • Troubleshooting
      • UI Developer Guide
        • DIGIT-UI
        • Android Web View & How To Generate APK
        • DIGIT UI Development Pre-requisites
        • UI Configuration (DevOps)
        • Local Development Setup
        • Run Application
        • Create New Screen In DIGIT-UI
          • Create Screen (FormComposer)
          • Inbox/Search Screen
          • Workflow Component
        • Customisation
          • Integrate External Web Application/UI With DIGIT UI
          • Utility - Pre-Process MDMS Configuration
          • CSS Customisation
        • Citizen Module Setup
          • Sample screenshots
          • Project Structure
          • Install Dependency
          • Import Required Components
          • Write Citizen Module Code
          • Citizen Landing Screen
        • Employee Module Setup
          • Write Employee Module Code
        • Build & Deploy
        • Setup Monitoring Tools
        • FAQs
          • Troubleshoot Using Browser Network Tab
          • Debug Android App Using Chrome Browser
    • 🔄Operations Guide
      • DIGIT - Infra Overview
      • Setup Central Instance Infra
      • Central Monitoring Dashboard Setup
      • Kubernetes
        • RBAC Management
        • DB Dump - Playground
      • Setup Jenkins - Docker way
      • GitOps
        • Git Client installation
        • GitHub organization creation
        • Adding new SSH key to it
        • GitHub repo creation
        • GitHub Team creation
        • Enabling Branch protection:
        • CODEOWNER Reviewers
        • Adding Users to the Git
        • Setting up an OAuth with GitHub
        • Fork (Fork the mdms,config repo with a tenant-specific branch)
      • Working with Kubernetes
        • Installation of Kubectl
      • Containerizing application using Docker
        • Creation of Dockerhub account
      • Infra provisioning using Terraform
        • Installation of Terraform
      • Customization of existing tf templates
      • Cert-Manager
        • Obtaining SSL certificates with the help of cluster-issuer
      • Moving Docker Images
      • Pre and post deployment checklist
      • Multi-tenancy Setup
      • Availability
        • Infrastructure
        • Backbone services
          • Database
          • Kafka
          • Kafka Connect
          • Elastic search
            • ElasticSearch Direct Upgrade
            • Elastic Search Rolling Upgrade
        • Core services
        • DIGIT apps
        • DSS dashboard
      • Observability
        • ES-Curator to clear old logs/indices
        • Monitoring
        • Tracing
        • Jaeger Tracing Setup
        • Logging
        • eGov Monitoring & Alerting Setup
        • eGov Logging Setup
      • Performance
        • What to monitor?
          • Infrastructure
          • Backbone services
          • Core services
        • Identifying bottlenecks
        • Solutions
      • Handling errors
      • Security
      • Reliability and disaster recovery
      • Privacy
      • Skillsets/hiring
      • Incident management processes
      • Kafka Troubleshooting Guide
        • How to clean up Kafka logs
        • How to change or reset consumer offset in Kafka?
      • SRE Rituals
      • FAQs
        • I am unable to login to the citizen or employee portal. The UI shows a spinner.
        • My DSS dashboard is not reflecting accurate numbers? What can I do?
      • Deployment using helm
        • Helm installation:
        • Helm chart creation
        • Helm chart customization
      • How to Dump Elasticsearch Indexes
      • Deploy Nginx-Ingress-Controller
      • Deployment Job Pipeline Setup
      • OAuth2-Proxy Setup
      • Jira Ticket Creation
  • Reference
    • 👉Setup Basics
      • Setup Requirements
        • Tech Enablement Training - Essential Skills and Pre-requisites
        • Tech Enablement Training (eDCR) - Essential Skills and Prerequisites
          • Development Control Rules (Digit-DCR)
          • eDCR Approach Guide
        • DIGIT Rollout Program Governance
        • DevOps Skills Requirements
        • Infra Requirements
        • Team Composition for DIGIT Implementation
        • Infra Best Practices
        • Operational Best Practices
        • Why Kubernetes For DIGIT
      • Supported Clouds
        • Google Cloud
        • Azure
        • AWS
        • VSphere
        • SDC
      • Deployment - Key Concepts
        • Security Practices
        • CI/CD
        • Readiness & Liveness
        • Resource Requests & Limits
      • Understanding ERP Stack
        • ERP Monolithic Architecture
        • ERP Hybrid Architecture
        • ERP Coexistence Architecture
        • APMDP-HYBRID-INFRA ARCHITECTURE
        • eGov SmartCity eGovernance Suite
        • ERP Deployment Process
        • ERP Release Process
        • ERP User Guide
      • Deploying DIGIT Services
        • Deployment Architecture
        • Routing Traffic
        • Backbone Deployment
      • Troubleshooting
        • Distributed Tracing
        • Logging
        • Monitoring & Alerts
    • 📥Reference Reads
      • Analytics
      • DevSecOps
      • Low Code No Code
        • Application Specification
      • Beneficiary Eligibility
      • Government and Open Digital Platforms
      • Microservices and Low Code No Code
      • Registries
      • Platform Orientation - Overview
    • 🔏Data Security
      • Signed Data Audit
      • Encryption Techniques
      • Approaches to handle Encrypted Data
    • ❕Privacy
    • 🕹️DevOps
      • 1. How DNS works
      • 2. Load Balancer
      • 3. SSL/Cert-manager
      • 4.Ingress,WAF
      • 5.VPC
      • 6.Subnets
      • 7.EKS
      • 8.Worker Node Group
      • 9.RDS
      • 10.NAT
      • 11.Internet Gateway
      • 12.Block Storage (EBS Volumes)
      • 13.Object Storage (S3)
      • 14. Telemetry
Powered by GitBook

All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.

On this page
  • Overview
  • Steps
  • Deploy PDF Service

Was this helpful?

  1. Guides
  2. Developer Guide
  3. Backend Developer Guide
  4. Section 5: Other Advanced Integrations

Certificate Generation

PreviousAdd Indexer ConfigurationNextSection 6: Run Final Application

Last updated 1 year ago

Was this helpful?

Overview

The final step in this process is the creation of configurations to create a voter registration PDF for the citizens to download. For this, we will make use of DIGIT’s PDF service which uses PDFMake and Mustache libraries to generate PDF. Detailed documentation on generating PDFs using PDF service is

Steps

Follow the below steps to set up PDF service locally and generate PDF for our voter registration service -

  1. Clone repo.

> git clone -o upstream https://github.com/egovernments/DIGIT-OSS
  1. Clone repo.

> git clone -o upstream https://github.com/egovernments/configs
  1. Navigate to the DIGIT-Dev repo and open up a terminal. Checkout DIGIT_DEVELOPER_GUIDE branch.

> cd DIGIT-Dev
> git checkout DIGIT_DEVELOPER_GUIDE
  1. Navigate to the configs folder and under pdf-service data config and format config folders, create file by the name of digit-developer-guide.json

> cd configs/pdf-service/data-config
> touch digit-developer-guide.json
  1. Add the following content in this newly created data config file -

{
  "key": "btcertificate",
  "DataConfigs": {
    "serviceName": "rainmaker-common",
    "version": "1.0.0",
    "baseKeyPath": "$.BirthRegistrationApplications.*",
    "entityIdPath":"$.id",
    "isCommonTableBorderRequired": true,
    "mappings": [
      {
        "mappings": [
          {
            "direct": [
              {
                "variable": "logoImage",
                "url":"https://raw.githubusercontent.com/egovernments/egov-web-app/master/web/rainmaker/dev-packages/egov-ui-kit-dev/src/assets/images/pblogo.png",
                "type":"image"
              },
              {
                "variable": "applicantName",
                "value": {
                  "path": "$.babyFirstName"
                }
              },
              {
                "variable": "applicationNo",
                "value": {
                  "path": "$.applicationNumber"
                }
              },
              {
                "variable": "address",
                "value": {
                  "path": "$.address.city"
                }
              },
              {
                "variable": "birthIdIssueDate",
                "value": {
                  "path": "$.auditDetails.createdTime"
                },
                "type": "date"
              },
              {
                "variable": "signedCertificateData",
                "value": {
                  "path": "$.signedCertificate"
                }
              },
              {
                "variable": "to",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_RECEIPT_TO"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "municipal_corportaion",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_MUNICIPAL_CORPORATION"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "corporation_contact",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_LICENSE_CORPORATION_CONTACT"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "corporation_website",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_LICENSE_CORPORATION_WEBSITE"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "corporation_email",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_LICENSE_CORPORATION_EMAIL"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "application_no",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_APPLICATION_NO"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "reciept_no",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_RECIEPT_NO"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "financial_year",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_FINANCIAL_YEAR"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "trade_name",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_TRADE_NAME"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "trade_owner_name",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_TRADE_OWNER_NAME"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "trade_owner_contact",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_TRADE_OWNER_CONTACT"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "trade_address",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_TRADE_ADDRESS"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "trade_type",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_TRADE_TYPE"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "accessories_label",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_ACCESSORIES_LABEL"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "trade_license_fee",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_TRADE_LICENSE_FEE"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "license_issue_date",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_LICENSE_ISSUE_DATE"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "license_validity",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_LICENSE_VALIDITY"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "approved_by",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_APPROVED_BY"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              },
              {
                "variable": "commissioner",
                "value": {
                  "path": "PDF_STATIC_LABEL_CONSOLIDATED_TLCERTIFICATE_COMMISSIONER"
                },
                "type": "label",
                "localisation":{
                  "required":true,
                  "prefix": null,
                  "module":"rainmaker-common"
                }
              }
            ]
          },
          {
            "externalAPI": [
              {
                "path": "http://localhost:8082/egov-mdms-service/v1/_get",
                "queryParam": "moduleName=tenant&masterName=tenants&tenantId=pb&filter=%5B?(@.code=='{$.tenantId}')%5D",
                "apiRequest": null,
                "responseMapping":[
                  {
                    "variable":"ulb-address",
                    "value":"$.MdmsRes.tenant.tenants[0].address"
                  },
                  {
                    "variable":"corporationContact",
                    "value":"$.MdmsRes.tenant.tenants[0].contactNumber"
                  },
                  {
                    "variable":"corporationWebsite",
                    "value":"$.MdmsRes.tenant.tenants[0].domainUrl"
                  },
                  {
                    "variable":"corporationEmail",
                    "value":"$.MdmsRes.tenant.tenants[0].emailId"
                  }
                ]
              },
              {
                "path": "http://localhost:8288/filestore/v1/files/url",
                "queryParam": "tenantId=pb,fileStoreIds=$.tradeLicenseDetail.applicationDocuments[?(@.documentType== 'OWNERPHOTO')].fileStoreId",
                "apiRequest": null,
                "requesttype": "GET",
                "responseMapping":[
                  {
                    "variable":"userpic",
                    "value":"$.fileStoreIds[0].url",
                    "type": "image"
                  }
                ]
              },
              {
                "path": "http://localhost:8282/egov-workflow-v2/egov-wf/process/_search",
                "queryParam": "businessIds=$.applicationNumber,history=true,tenantId=$.tenantId",
                "apiRequest": null,
                "responseMapping":[
                  {
                    "variable":"approvedBy",
                    "value":"$.ProcessInstances[?(@.action == 'APPROVE')].assigner.name"
                  }

                ]
              }

            ]
          },
          {
            "qrcodeConfig": [
              {
                "variable": "qrCode",
                "value": "{{signedCertificateData}}"
              }
            ]
          }
        ]

      }
    ]
  }
}
  1. Create a file by the name of digit-developer-guide.json format-config folder and place the following content in it -

{
  "key": "vtcertificate",
  "config": {
    "defaultStyle": {
      "font": "Cambay"
    },
    "content": [
      {
        "image": "{{qrCode}}",
        "absolutePosition" : {
          "x" : 480,
          "y" : 5
        },
        "width": 100,
        "height": 100
      },
      {
        "style":"noc-head",
        "table":{
          "widths":[
            "*"
          ],
          "body":[
            [
              {
                "image": "{{userpic}}",
                "width": 70,
                "height": 82,
                "alignment": "center",
                "margin": [
                  0,
                  10,
                  0,
                  10
                ]
              }
            ],
            [
              {
                "stack": [
                  {
                    "text":"{{municipal_corportaion}}",
                    "style":"receipt-logo-header"
                  },
                  {
                    "text":"{{ulb-address}}",
                    "style":"receipt-logo-sub-header"
                  },
                  {
                    "style": "noc-head",
                    "table": {
                      "widths": [
                        "*",
                        "*"
                      ],
                      "body": [
                        [
                          {
                            "text": "{{corporation_contact}} : {{corporationContact}} ",
                            "style": "receipt-sub-address-sub-header"

                          }
                        ]
                      ]
                    },
                    "layout": "noBorders"
                  },
                  {
                    "style": "noc-head",
                    "table": {
                      "widths": [
                        "*",
                        "*"
                      ],
                      "body": [
                        [
                          {
                            "text": "{{corporation_website}} : {{corporationWebsite}}",
                            "style": "receipt-sub-website-sub-header"

                          }
                        ]
                      ]
                    },
                    "layout": "noBorders"
                  },
                  {
                    "style": "noc-head",
                    "table": {
                      "widths": [
                        "*",
                        "*"
                      ],
                      "body": [
                        [
                          {
                            "text": "{{corporation_email}} : {{corporationEmail}}",
                            "style": "receipt-sub-email-sub-header"

                          }
                        ]
                      ]
                    },
                    "layout": "noBorders"
                  }
                ],
                "alignment":"left",
                "margin":[
                  0,
                  10,
                  0,
                  0
                ]
              }
            ],
            [
              {
                "stack": [
                  {
                    "text":"Birth Certificate",
                    "style":"receipt-sub-logo-header"
                  },
                  {
                    "style":"noc-head",
                    "table":{
                      "widths":[
                        "35%",
                        "65%"
                      ],
                      "body":[
                        [
                          {
                            "text":"Applicant Name",
                            "style":"receipt-sub-logo-sub-header"
                          },
                          {
                            "text":"{{applicantName}}",
                            "style":"receipt-sub-logo-sub-header"
                          }
                        ]
                      ]
                    },
                    "layout":"noBorders"
                  },
                  {
                    "style":"noc-head",
                    "table":{
                      "widths":[
                        "35%",
                        "65%"
                      ],
                      "body":[
                        [
                          {
                            "text":"Application Number",
                            "style":"receipt-sub-logo-sub-header"
                          },
                          {
                            "text":"{{applicationNo}}",
                            "style":"receipt-sub-logo-sub-header"
                          }
                        ]
                      ]
                    },
                    "layout":"noBorders"
                  },
                  {
                    "style":"noc-head",
                    "table":{
                      "widths":[
                        "35%",
                        "65%"
                      ],
                      "body":[
                        [
                          {
                            "text":"Applicant Address",
                            "style":"receipt-sub-logo-sub-header"
                          },
                          {
                            "text":"{{address}}",
                            "style":"receipt-sub-logo-sub-header"
                          }
                        ]
                      ]
                    },
                    "layout":"noBorders"
                  },
                  {
                    "style":"noc-head",
                    "table":{
                      "widths":[
                        "35%",
                        "65%"
                      ],
                      "body":[
                        [
                          {
                            "text":"Certificate Issue Date",
                            "style":"receipt-sub-logo-sub-header"
                          },
                          {
                            "text":"{{birthIdIssueDate}}",
                            "style":"receipt-sub-logo-sub-header"
                          }
                        ]
                      ]
                    },
                    "layout":"noBorders"
                  }
                ],
                "alignment":"left",
                "margin":[
                  0,
                  10,
                  0,
                  0
                ]
              }
            ]
          ]
        },
        "layout":"noBorders"
      },
      {
        "style":"receipt-approver",
        "columns": [
          {
            "text":[
              {
                "text":"{{approved_by}} ",
                "bold": true
              },
              {
                "text":" {{approvedBy}}",
                "bold": false
              }
            ],
            "alignment":"left"
          },
          {
            "text":[
              {
                "text":"{{commissioner}}",
                "bold": true
              }
            ],
            "alignment":"right"
          }
        ]
      }
    ],
    "styles": {
      "noc-head": {
        "margin": [
          -30,
          -35,
          0,
          -2
        ]
      },
      "receipt-approver": {
        "color": "#000000",
        "fontSize": 14,
        "letterSpacing": 0.6,
        "alignment": "center",
        "margin": [
          -10,
          50,
          0,
          1
        ]
      },
      "receipt-logo-header": {
        "color": "#000000",
        "fontSize": 20,
        "letterSpacing": 0.74,
        "alignment": "center",
        "margin": [
          0,
          0,
          0,
          5
        ]
      },
      "receipt-sub-logo-header": {
        "color": "#000000",
        "fontSize": 18,
        "letterSpacing": 0.74,
        "alignment": "center",
        "margin": [
          0,
          5,
          0,
          5
        ]
      },
      "receipt-logo-sub-header": {
        "color": "#484848",
        "fontSize": 14,
        "letterSpacing": 0.6,
        "alignment": "center",
        "margin": [
          0,
          5,
          0,
          0
        ]
      },
      "receipt-sub-logo-sub-header": {
        "color": "#484848",
        "fontSize": 14,
        "letterSpacing": 0.6,
        "alignment": "left",
        "margin": [
          50,
          40,
          0,
          0
        ]
      },
      "receipt-sub-address-sub-header": {
        "color": "#484848",
        "fontSize": 14,
        "letterSpacing": 0.1,
        "alignment": "right",
        "margin": [
          50,
          30,
          -90,
          0
        ]
      },
      "receipt-sub-website-sub-header": {
        "color": "#484848",
        "fontSize": 14,
        "letterSpacing": 0.1,
        "alignment": "right",
        "margin": [
          50,
          30,
          -120,
          0
        ]
      },
      "receipt-sub-email-sub-header": {
        "color": "#484848",
        "fontSize": 14,
        "letterSpacing": 0.1,
        "alignment": "right",
        "margin": [
          50,
          30,
          -110,
          0
        ]
      }
    }
  }
}
  1. Open the PDF service (under core-services repository of DIGIT-Dev) on your IDE. Open Environment.js file and change the following properties to point to the local config files created. For example, in my local setup I have pointed these to the local files that I created -

DATA_CONFIG_URLS: "file:///eGov/configs/pdf-service/data-config/digit-developer-guide.json",
FORMAT_CONFIG_URLS: "file:///eGov/configs/pdf-service/format-config/digit-developer-guide.json"
  1. Make sure that Kafka and Workflow services are running locally and port-forward the following services -

    • egov-user to port 8284

    • egov-localization to port 8286

    • egov-filestore to 8288

    • egov-mdms to 8082

  2. PDF service is now ready to be started up. Execute the following commands to start it up

> npm install
> npm run dev
  1. Once PDF service is up hit the following cURL to look at the created PDF -

curl --location --request POST 'http://localhost:8081/pdf-service/v1/_createnosave?key=vtcertificate&tenantId=pb' \
--header 'authority: dev.digit.org' \
--header 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"' \
--header 'accept: application/json' \
--header 'dnt: 1' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36' \
--header 'content-type: application/json;charset=UTF-8' \
--header 'origin: https://dev.digit.org' \
--header 'sec-fetch-site: same-origin' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-dest: empty' \
--header 'referer: https://dev.digit.org/employee/tradelicence/search-preview?applicationNumber=PB-TL-2021-07-13-006531&tenantId=pb.amritsar' \
--header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'cookie: _ga=GA1.2.1990427088.1605864396; amplitude_id_fef1e872c952688acd962d30aa545b9edigit.org=eyJkZXZpY2VJZCI6IjQzYzEyMDE0LTNhNTYtNGRiMS1iNDQzLTA5NWU2Zjc3ZGU2MlIiLCJ1c2VySWQiOm51bGwsIm9wdE91dCI6ZmFsc2UsInNlc3Npb25JZCI6MTYyMjUyNjY2NTkxMywibGFzdEV2ZW50VGltZSI6MTYyMjUyNjcyMTQyNywiZXZlbnRJZCI6MiwiaWRlbnRpZnlJZCI6MSwic2VxdWVuY2VOdW1iZXIiOjN9' \
--data-raw '{
    "RequestInfo": {
        "apiId": "Rainmaker",
        "ver": ".01",
        "action": "_get",
        "did": "1",
        "key": "",
        "msgId": "20170310130900|en_IN",
        "requesterId": "",
        "authToken": "2c21ee1f-2b26-47bf-8ce8-39cc88b0ca3f",
        "responseType": "arraybuffer",
        "userInfo": {
            "id": 24226,
            "uuid": "40dceade-992d-4a8f-8243-19dda76a4171",
            "userName": "amr001",
            "name": "leela",
            "mobileNumber": "9814424443",
            "emailId": "leela@llgmail.com",
            "locale": null,
            "type": "EMPLOYEE",
            "roles": [
                {
                    "name": "PT Doc Verifier",
                    "code": "PT_DOC_VERIFIER",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "PT Counter Employee",
                    "code": "PT_CEMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "PT Field Inspector",
                    "code": "PT_FIELD_INSPECTOR",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "PT Counter Approver",
                    "code": "PT_APPROVER",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Property Approver",
                    "code": "Property Approver",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "CSC Collection Operator",
                    "code": "CSC_COLL_OPERATOR",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Employee",
                    "code": "EMPLOYEE",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "NoC counter employee",
                    "code": "NOC_CEMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "TL Counter Employee",
                    "code": "TL_CEMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Anonymous User",
                    "code": "ANONYMOUS",
                    "tenantId": "pb"
                },
                {
                    "name": "TL Field Inspector",
                    "code": "TL_FIELD_INSPECTOR",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "TL Creator",
                    "code": "TL_CREATOR",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "NoC counter Approver",
                    "code": "NOC_APPROVER",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "TL Approver",
                    "code": "TL_APPROVER",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Super User",
                    "code": "SUPERUSER",
                    "tenantId": "pb"
                },
                {
                    "name": "BPA Services Approver",
                    "code": "BPA_APPROVER",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Field Employee",
                    "code": "FEMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Counter Employee",
                    "code": "CEMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "NoC Field Inpector",
                    "code": "NOC_FIELD_INSPECTOR",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Super User",
                    "code": "SUPERUSER",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Grievance Officer",
                    "code": "GO",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "NoC Doc Verifier",
                    "code": "NOC_DOC_VERIFIER",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Collection Operator",
                    "code": "COLL_OPERATOR",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "TL doc verifier",
                    "code": "TL_DOC_VERIFIER",
                    "tenantId": "pb.amritsar"
                }
            ],
            "active": true,
            "tenantId": "pb.amritsar"
        }
    },
    "BirthRegistrationApplications": [
         {
            "id": "49e39cd5-a907-44ab-b654-1ff1bd121251",
            "tenantId": "pb.amritsar",
            "applicationNumber": "PB-BTR-2022-09-07-000377",
            "babyFirstName": "Rahul",
            "babyLastName": "Singh",
            "fatherMobileNumber": null,
            "motherMobileNumber": null,
            "doctorName": "Dr. Ram",
            "hospitalName": "Fortis",
            "placeOfBirth": "Palampur",
            "timeOfBirth": 12072001,
            "address": {
                "tenantId": "pb.amritsar",
                "doorNo": "1010",
                "latitude": 0.0,
                "longitude": 0.0,
                "addressId": null,
                "addressNumber": "34 GA",
                "type": "RESIDENTIAL",
                "addressLine1": "KP Layout",
                "addressLine2": "",
                "landmark": "Petrol pump",
                "city": "Amritsar",
                "pincode": "143501",
                "detail": "adetail",
                "buildingName": "Avigna Residence",
                "street": "12th Main",
                "locality": null,
                "registrationId": "aregistrationid",
                "id": "c5b2c706-7f49-4948-b1b4-4554eff54cb0"
            },
            "fatherOfApplicant": {
                "id": "61646440-d184-48f2-92b3-1b50a7babcf3",
                "userName": null,
                "password": null,
                "salutation": null,
                "name": null,
                "gender": null,
                "mobileNumber": null,
                "emailId": null,
                "altContactNumber": null,
                "pan": null,
                "aadhaarNumber": null,
                "permanentAddress": null,
                "permanentCity": null,
                "permanentPincode": null,
                "correspondenceCity": null,
                "correspondencePincode": null,
                "correspondenceAddress": null,
                "active": null,
                "dob": null,
                "pwdExpiryDate": null,
                "locale": null,
                "type": null,
                "signature": null,
                "accountLocked": null,
                "roles": null,
                "fatherOrHusbandName": null,
                "bloodGroup": null,
                "identificationMark": null,
                "photo": null,
                "createdBy": null,
                "createdDate": null,
                "lastModifiedBy": null,
                "lastModifiedDate": null,
                "otpReference": null,
                "tenantId": null
            },
            "motherOfApplicant": {
                "id": "99856298-68ba-479f-aa31-f2f4954102f6",
                "userName": null,
                "password": null,
                "salutation": null,
                "name": null,
                "gender": null,
                "mobileNumber": null,
                "emailId": null,
                "altContactNumber": null,
                "pan": null,
                "aadhaarNumber": null,
                "permanentAddress": null,
                "permanentCity": null,
                "permanentPincode": null,
                "correspondenceCity": null,
                "correspondencePincode": null,
                "correspondenceAddress": null,
                "active": null,
                "dob": null,
                "pwdExpiryDate": null,
                "locale": null,
                "type": null,
                "signature": null,
                "accountLocked": null,
                "roles": null,
                "fatherOrHusbandName": null,
                "bloodGroup": null,
                "identificationMark": null,
                "photo": null,
                "createdBy": null,
                "createdDate": null,
                "lastModifiedBy": null,
                "lastModifiedDate": null,
                "otpReference": null,
                "tenantId": null
            },
            "auditDetails": {
                "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                "lastModifiedBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                "createdTime": 1662545605812,
                "lastModifiedTime": 1662545605812
            },
            "workflow": null
        }
    ]
}'

Note: Follow the steps below when the code is deployed to the DIGIT environment. These steps are not applicable for deployment in the local environment. You may choose to follow these when you build and deploy.

Deploy PDF Service

  • Navigate to the forked DIGIT-DevOps repository.

  • Find the deployment helm chart that was used to deploy DIGIT within the deploy-as-code/helm/environments directory.

  • Find "pdf-service"in the deployment helm chart (which was used to set up the DIGIT environment).

  • Find the "data-config-urls" property.

  • Add the path to your new PDF config file here. For this module, we have added file:///work-dir/configs/pdf-service/data-config/digit-developer-guide.json to the end of the data-config-urls. The code block is shown below for reference:

pdf-service:
  replicas: 1
  initContainers:
    gitSync:
      repo: "git@github.com:egovernments/configs"
      branch: "DEV"
  data-config-urls: "file:///work-dir/configs/pdf-service/data-config/tradelicense-receipt.json,file:///work-dir/configs/pdf-service/data-config/property-receipt.json,file:///work-dir/configs/pdf-service/data-config/property-bill.json,file:///work-dir/configs/pdf-service/data-config/tradelicense-bill.json,file:///work-dir/configs/pdf-service/data-config/firenoc-receipt.json,file:///work-dir/configs/pdf-service/data-config/pt-receipt.json,file:///work-dir/configs/pdf-service/data-config/tl-receipt.json,file:///work-dir/configs/pdf-service/data-config/consolidatedbill.json,file:///work-dir/configs/pdf-service/data-config/consolidatedreceipt.json,file:///work-dir/configs/pdf-service/data-config/tlapplication.json,file:///work-dir/configs/pdf-service/data-config/ws-consolidatedacknowlegment.json,file:///work-dir/configs/pdf-service/data-config/ws-consolidatedsewerageconnection.json,file:///work-dir/configs/pdf-service/data-config/tlcertificate.json,file:///work-dir/configs/pdf-service/data-config/buildingpermit.json,file:///work-dir/configs/pdf-service/data-config/ptmutationcertificate.json,file:///work-dir/configs/pdf-service/data-config/tlrenewalcertificate.json,file:///work-dir/configs/pdf-service/data-config/bpa-revocation.json,file:///work-dir/configs/pdf-service/data-config/ws-applicationsewerage.json,file:///work-dir/configs/pdf-service/data-config/ws-applicationwater.json,file:///work-dir/configs/pdf-service/data-config/buildingpermit-low.json,file:///work-dir/configs/pdf-service/data-config/misc-receipt.json,file:///work-dir/configs/pdf-service/data-config/ws-estimationnotice.json,file:///work-dir/configs/pdf-service/data-config/ws-sanctionletter.json,file:///work-dir/configs/pdf-service/data-config/ws-bill.json,file:///work-dir/configs/pdf-service/data-config/ws-onetime-receipt.json,file:///work-dir/configs/pdf-service/data-config/occupancy-certificate.json, file:///work-dir/configs/pdf-service/data-config/bill-amendment.json, file:///work-dir/configs/pdf-service/data-config/bill-amendment-note.json, file:///work-dir/configs/pdf-service/data-config/fsm-receipt.json, file:///work-dir/configs/pdf-service/data-config/sewerage-bill-amendment-note.json, file:///work-dir/configs/pdf-service/data-config/mcollect-bill.json, file:///work-dir/configs/pdf-service/data-config/mcollect-challan.json,file:///work-dir/configs/pdf-service/data-config/birth-certificate-pdf.json, file:///work-dir/configs/pdf-service/data-config/death-certificate.json,file:///work-dir/configs/pdf-service/data-config/ws-waterdisconnection.json,file:///work-dir/configs/pdf-service/data-config/ws-sewagedisconnection.json,file:///work-dir/configs/pdf-service/data-config/ws-waterdisconnectionnotice.json,file:///work-dir/configs/pdf-service/data-config/ws-seweragedisconnectionnotice.json,file:///work-dir/configs/pdf-service/data-config/ws-sewerageconnectiondetails.json,file:///work-dir/configs/pdf-service/data-config/ws-waterconnectiondetails-metered.json,file:///work-dir/configs/pdf-service/data-config/ws-waterconnectiondetails-nonmetered.json,file:///work-dir/configs/pdf-service/data-config/digit-developer-guide.json"
  • Raise a PR for this to the appropriate branch of DevOps which was forked/used to create the deployment.

  • Restart the PDF service in the k8s cluster, once the PR is merged. It will pick up the latest config from the file above.

⚒️
available here.
DIGIT Services
Configs