DIGIT Urban
PlatformDomainsAcademyDesign SystemFeedback
v2.1
v2.1
  • DIGIT Urban
  • What’s New in DIGIT Urban 2.1?
  • DIGIT Architecture
  • Product & Modules
    • Brochures
    • User Manuals
      • Logging Into DIGIT
      • Building Plan Approval (BPA)
        • Citizen User Manual
        • Employee User Manual
      • Trade License
        • Citizen User Manual
        • Employee User Manual
      • Public Grievance & Redressal
        • Citizen User Manual
        • Employee User Manual
        • Complaint Types List
      • Property Tax
        • Citizen User Manual
        • Employee User Manual
      • Water & Sewerage
        • Citizen User Manual
        • Employee User Manual
      • mCollect
        • Citizen User Manual
        • Employee User Manual
    • Services Overview
      • Core Services
        • Workflow Services
        • Location Services
        • User Services
        • Access Control Services
        • PDF Generation Service
        • MDMS (Master Data Management Service)
        • Payment Gateway Service
        • User Session Management In DIGIT
        • Indexer Service
        • URL Shortening Service
      • Business Service
      • Municipal Service
        • PGR Services 2.0
          • PGR Migration
        • Trade-License Service
      • Utilities
    • Release Notes DIGIT 2.1
      • BPA 2.1 Release Notes
      • Property Tax 2.1 Release Notes
      • PGR 2.1 Release Notes
      • Water & Sewerage 2.1 Release Notes
      • DSS 2.1 Release Notes
      • Configuration Changes
    • DIGIT Roadmap
    • Product FAQs
    • Quality Assurance
  • Configure DIGIT
    • Git Repos
    • Setting up DIGIT
      • Configuring InfraOps
      • Setting up DIGIT Environment
      • Email And SMS Setup
      • FileStore Setup
      • Setting Up SSL Certificate
      • Periodic Log Cleanup
    • Setting up Master Data
      • MDMS Overview
      • Configuring Tenants
      • Configuring Master Data
      • Adding New Master
      • State Level Vs City Level Master
    • Master Data Collection Templates
      • Environment Setup
        • State Level Setup
          • Tenants Information
          • SMS Account Configuration
          • Email Account Configuration
          • Google Play Store Account
          • Payment Gateway Configuration
          • POS Integration Configuration
          • Domain Name Configuration
          • SSL Configuration
          • ULB Departments
          • ULB Designations
          • Localization
          • Google Map Configuration
        • ULB Level Setup
          • Boundary Hierarchies
          • Boundary Data
          • Cross Hierarchy Mapping
          • ULB Bank Accounts
      • Module Setup
        • Trade Licenses Templates
          • Trade Category
          • Trade Type
          • Trade Sub Type
          • Trade License Fee
          • Trade License Documents Attachment
          • Structure Type
          • Structure Sub Type
        • Property Tax Data Templates
          • Road Type
          • Construction Type
          • Property Type
          • Property Sub Type
          • Usage Category Major
          • Usage Category Minor
          • Usage Category Sub Minor
          • Usage Category Detail
          • Ownership Category
          • Ownership Sub Category
          • Owner Special Category
          • Special Category Documents
          • Unit Rates
          • Tax Rates
          • Interest Rates
          • Penalty Rates
          • Rebate Rates
          • Mutation Fee
        • PGR Data Templates
          • Grievance Type
          • Grievance Sub Type
          • Routing Matrix
          • Escalation Matrix
        • Fire NOC Data Templates
          • Building Usage Type
          • Building Sub Usage Type
          • Fire Station Master
          • Areas Served Master
          • Fire Station Mapping
          • Fire NOC Fee
        • mCollect Data Templates
          • Service Category
          • Service Sub Category
          • Service Sub Category GL Code Mapping
        • Web Portals Templates
          • State Portal
          • ULB Portal
        • OBPAS Data Templates
          • List Of Services
          • Service-Wise Documents
          • Building Occupancy
          • Building Sub Occupancy
          • Building Usage
          • Inspection Checklist
          • Stakeholders Type
          • Town Planning Schemes
          • NOC Departments
          • Fee Structure
          • eDCR Drawing
        • HRMS Data Templates
          • User Roles
          • System Users
        • Finance Data Templates
          • Chart Of Accounts
          • Funds
          • Functions
          • Contractors
          • Suppliers
          • Schemes
          • Sub Schemes
          • Bank
          • Bank Branch
          • Bank Account
          • Deductions
          • Opening Balances
          • Sub Ledger Category
          • Sub Ledger Master
        • Water Charges Data Templates
          • Pipe Size Types
          • Water Source Types
          • Water Rates (Metered)
          • Water Rates (Non-Metered)
          • Water Penalty Rates
          • Water Interest Rates
        • Sewerage Charges Data Templates
          • Sewerage Rates
          • Sewerage Penalty Rates
          • Sewerage Interest Rates
        • Billing And Payments Data Templates
          • Tax Heads
          • Receipt Format
          • Demand Bill Format
        • DSS Data Templates
          • KPI Acceptance
        • Workflow Data Templates
          • Workflow Actions
          • Workflow Levels
          • Workflow Process
          • Workflow Notifications
        • Common Configuration Details
          • Standard Document List
          • Service Document Mapping
          • Checklist
          • Configuring Data FAQs
    • Configuring Workflows
      • Setting Up Workflows
      • Configuring Workflows For An Entity
    • Configuring Services
      • API Dos and Don'ts
      • Setting Up Service Locally
      • Configuring New Reports
        • Types Of Reports Used In Report Service
        • Impact Of Heavy Reports On Platform
      • Customizing PDF Notices And Certificates
        • Integration Of PDF In UI For Download And Print PDF
        • Customizing PDF Receipts & Certificates
    • Setting up a Language
      • Adding New Language
      • Setting Up Default Language For SMS & Emails
    • Configuring Localization
      • Setup Base Product Localization
      • Configure SMS and Email
    • Setting Up SMS Gateway
      • Using The Generic GET & POST SMS Gateway Interface
    • Configuration FAQs
    • Setting Up eDCR Service
    • Adding Roles To System
    • Mapping Roles With APIs
    • DSS Configuration And Setup
      • Building New Dashboards
    • Setting Up Finance Service
    • Adding New APIs For Access
    • Deployment Of App on Play Store
  • Customize DIGIT
    • Frontend/UI
    • DIGIT Customization
      • API Do's & Don'ts
      • Writing A New Customer
    • Services
      • Core Services
      • Business Services
      • Municipal Services
      • Infra Services
    • Master & Configuration data load kit
    • Data Migration
      • Data Migration Principles
      • Data Templates
      • Data Migration Kit
  • Deployment Tools
    • Setup DIGIT
      • Infra Requirements
      • Infra Best Practices
      • Operational Best practices
      • Why Kubernetes for DIGIT
      • Supported Clouds
        • Google Cloud
        • Azure
        • AWS
        • VSphere
        • SDC
        • NIC
      • Infra Sizing
      • Deployment Architecture
      • Deploy DIGIT
        • Routing Traffic
        • Backbone Deployment
    • Skills Needed
    • Resource Requests & Limits
    • Readiness & Liveness
    • Troubleshooting
      • Distributed Tracing
      • Logging
      • Monitoring & Alerts
    • CI/CD
    • Security Practices
  • DIGIT Training Materials
    • Training Calendar
    • Training Videos
  • DIGIT Support
    • eGov Enablement Support for DIGIT
    • Troubleshooting Guide
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
  • Pre-requisites
  • Key Functionalities
  • Deployment Details
  • Configuration Details
  • Integration
  • Integration Scope
  • Integration Benefits
  • Steps to Integration
  • Reference Docs
  • Doc Links
  • API List

Was this helpful?

Edit on Git
Export as PDF
  1. Configure DIGIT
  2. Configuring Services
  3. Customizing PDF Notices And Certificates

Integration Of PDF In UI For Download And Print PDF

Overview

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

Pre-requisites

Before you proceed with the documentation, make sure the following pre-requisites are met -

  • All required data and format file path is added in the environment yml file

  • pdf-service is up and running

Key Functionalities

  • Provide functionality to download and print PDF’s

  • Provide functionality to download and print bulk PDF’s

Deployment Details

  1. Create data config and format config for a PDF according to product requirement.

  2. Add data config and format config files in PDF configuration

  3. Add the file path of data and format config in the environment yml file

  4. Deploy the latest version of pdf-service in a particular environment.

Configuration Details

For Configuration details please refer to the Customizing PDF Receipts & Certificates document in Reference Docs

Integration

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 a maximum number of records to be written in one PDF

  • Uploading generated PDF to filestore and return filestore id for easy access

Steps to Integration

The following are the steps for integrating TL certificate in UI.

In footer.js file which is present in /frontend/web/rainmaker/dev-packages/egov-tradelicence-dev/src/ui-config/screens/specs/tradelicence/applyResource , Create two object (download and print object) in footerReview function.

Example

let tlCertificateDownloadObject = {
    label: { labelName: "TL Certificate", labelKey: "TL_CERTIFICATE" },
    link: () => {
      const { Licenses } = state.screenConfiguration.preparedFinalObject;
      downloadCertificateForm(Licenses);
    },
    leftIcon: "book"
  };
  let tlCertificatePrintObject = {
    label: { labelName: "TL Certificate", labelKey: "TL_CERTIFICATE" },
    link: () => {
      generateReceipt(state, dispatch, "certificate_print");
    },
    leftIcon: "book"
  };

In tlCertificateDownloadObject give the proper label name and key for the pdf. In the link function get the object whose mapping is required for PDF, in this case, we want a license object. Call the function downloadCertificateForm (details about this function is described in the next step). Add icon details which we want to use in UI to represent that option. The same thing for tlcertificatePrintObject only difference is we have to call generateReceipt function. Again create the same two object with similar content in downloadPrintContainer function.

Mention the function name “downloadCertificateForm“ and “generateReceipt“ in import , because the functions is define in /frontend/web/rainmaker/dev-packages/egov-tradelicence-dev/src/ui-config/screens/specs/utils/index.js and /frontend/web/rainmaker/dev-packages/egov-tradelicence-dev/src/ui-config/screens/specs/utils/receiptPDF.js

In index.js define the function which is responsible for calling the Create API of PDF service to create respective PDF. In that function, you have to mention the tenant ID and proper key value which is the same as the key mentioned in the data and format config. Also mentioned the URL : /pdf-service/v1/_create and action as get and also call the function downloadReceiptFromFilestoreID which is responsible to call filestore service with filestoreid and return the URL for pdf.

Example of function downloadCertificateForm

export const downloadCertificateForm = (Licenses) => {
  const queryStr = [
    { key: "key", value: "tlcertificate" },
    { key: "tenantId", value: "pb" }
  ]
  const DOWNLOADRECEIPT = {
    GET: {
      URL: "/pdf-service/v1/_create",
      ACTION: "_get",
    },
  };
  try {
    httpRequest("post", DOWNLOADRECEIPT.GET.URL, DOWNLOADRECEIPT.GET.ACTION, queryStr, { Licenses }, { 'Accept': 'application/json' }, { responseType: 'arraybuffer' })
      .then(res => {
        res.filestoreIds[0]
        if (res && res.filestoreIds && res.filestoreIds.length > 0) {
          res.filestoreIds.map(fileStoreId => {
            downloadReceiptFromFilestoreID(fileStoreId)
          })
        } else {
          console.log("Error In Acknowledgement form Download");
        }
      });
  } catch (exception) {
    alert('Some Error Occured while downloading Acknowledgement form!');
  }
}

Example of function generateReceipt

const generateReceipt = async (state, dispatch, type) => {
//  console.log("Transformed Data--",transformedData);
  pdfMakeCustom.vfs = pdfFonts.vfs;
  pdfMakeCustom.fonts = {
    Camby:{
            normal: 'Cambay-Regular.ttf',
            bold: 'Cambay-Regular.ttf',
            italics: 'Cambay-Regular.ttf',
            bolditalics: 'Cambay-Regular.ttf'
    },

  };
  let data1 = _.get(
    state.screenConfiguration.preparedFinalObject,
    "applicationDataForReceipt",
    {}
  );
  let data2 = _.get(
    state.screenConfiguration.preparedFinalObject,
    "receiptDataForReceipt",
    {}
  );
  let data3 = _.get(
    state.screenConfiguration.preparedFinalObject,
    "mdmsDataForReceipt",
    {}
  );
  let data4 = _.get(
    state.screenConfiguration.preparedFinalObject,
    "userDataForReceipt",
    {}
  );
  let data5 = _.get(
    state.screenConfiguration.preparedFinalObject.Licenses[0].tradeLicenseDetail,
    "address",
    {}
  );

  let ulbLogo = _.get(
    state.screenConfiguration.preparedFinalObject,
    "base64UlbLogo",
    ""
  );
  if (_.isEmpty(data1)) {
    console.log("Error in application data");
    return;
  } else if (_.isEmpty(data2)) {
    console.log("Error in receipt data");
    return;
  } else if (_.isEmpty(data3)) {
    console.log("Error in mdms data");
    return;
  } else if (_.isEmpty(data4)) {
    console.log("Error in auditor user data");
    return;
  } else if (_.isEmpty(ulbLogo)) {
    console.log("Error in image data");
    return;
  }
  let transformedData = {
    ...data1,
    ...data2,
    ...data3,
    ...data4,
    actualAddress:data5
  };
  switch (type) {
    case "certificate_download":

      let certificate_data = getCertificateData(transformedData, ulbLogo);
      certificate_data &&
     //  pdfMakeCustom.createPdf(certificate_data).download("tl_certificate.pdf");
      pdfMakeCustom.createPdf(certificate_data).open();
      break;
    case "certificate_print":
      certificate_data = getCertificateData(transformedData, ulbLogo);
      certificate_data && pdfMakeCustom.createPdf(certificate_data).print();
      break;
    case "receipt_download":
      let receipt_data = getReceiptData(transformedData, ulbLogo);

      receipt_data &&
     //   pdfMakeCustom.createPdf(receipt_data).download("tl_receipt.pdf");
        pdfMakeCustom.createPdf(receipt_data).open();
      break;
    case "receipt_print":
      receipt_data = getReceiptData(transformedData, ulbLogo);
      receipt_data && pdfMakeCustom.createPdf(receipt_data).print();
      break;
    default:
      break;
  }
};

Reference Docs

Doc Links

Title

Link

PDF Generation service technical documentation

Customizing PDF Receipts & Certificates

API Swagger Documentation

API List

Link

pdf-service/v1/_create

pdf-service/v1/_createnosave

pdf-service/v1/_search

(Note: All the API’s are in the same postman collection therefore the same link is added in each row)

PreviousCustomizing PDF Notices And CertificatesNextCustomizing PDF Receipts & Certificates

Last updated 4 years ago

Was this helpful?

PDF Generation Service
Customizing PDF Receipts & Certificates
Swagger Documentation
https://www.getpostman.com/collections/5a9bfd6fd03f9f2a6fad
https://www.getpostman.com/collections/5a9bfd6fd03f9f2a6fad
https://www.getpostman.com/collections/5a9bfd6fd03f9f2a6fad