How to use the pdfmake/build/pdfmake.fonts function in pdfmake

To help you get started, we’ve selected a few pdfmake examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github egovernments / egov-services / web / react-pgr-web-v2 / src / components / framework / specs / legal / templates / VakalatnamaTemplate.js View on Github external
generatePdf = (ulbLogo, stateLogo, ulbName) => {
    let { data } = this.props;
    let { getAdvocateNames } = this;
    //assigning fonts
    pdfMake.fonts = fonts;

    var addres = data.summon.courtName.address.addressLine1 ? data.summon.courtName.address.addressLine1 + ', ' : '';
    addres += data.summon.courtName.address.city ? data.summon.courtName.address.city + ', ' : '';
    addres += data.summon.courtName.address.addressLine2 ? data.summon.courtName.address.addressLine2 : '';

    // console.log(data.witness);
    //console.log(data);

    var d = new Date(data.vakalatnamaGenerationDate);
    var monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
    var dayNames = [
      'First',
      'Second',
      'Third',
      'Fourth',
      'Fifth',
github egovernments / egov-services / web / react-pgr-web-v2 / src / components / non-framework / tl / search / NoticeSearchResult.js View on Github external
import {Table} from 'react-bootstrap';
import Dialog from 'material-ui/Dialog';
import {Card, CardHeader, CardText} from 'material-ui/Card';
import FlatButton from 'material-ui/FlatButton';
import {translate, epochToDate} from '../../../common/common';
import Api from '../../../../api/api';
import styles from '../../../../styles/material-ui';

import $ from 'jquery';
import JSZip from 'jszip/dist/jszip';
import pdfMake from "pdfmake/build/pdfmake";
import pdfFonts from "pdfmake/build/vfs_fonts";
import 'datatables.net-buttons/js/buttons.html5.js';// HTML 5 file export
import 'datatables.net-buttons/js/buttons.flash.js';// Flash file export
import {fonts} from '../../../common/pdf-generation/PdfConfig';
pdfMake.fonts = fonts;
window.JSZip = JSZip;

export default class NoticeSearchResult extends Component{
  constructor(){
    super();
    this.state={
      open:false
    };
  }
  componentDidMount(){
    for(var k in this.props.noticeSearch){
      if(!this.props.noticeSearch[k])
        delete this.props.noticeSearch[k];
    }
    this.getSearchNotice(this.props.searchParams);
  }
github egovernments / egov-services / web / react-pgr-web / src / components / non-framework / tl / transaction / Acknowledgement.js View on Github external
generatePdf = (ulbLogo, stateLogo, certificateConfigDetails, ulbName) => {
    let {license} = this.props;
    //assigning fonts
    pdfMake.fonts = fonts;

    //document defintion
    var docDefinition = {
      pageSize: 'A4',
      pageMargins: [ 30, 30, 30, 30 ],
      content: [
        //Pdf header
        {
          columns: [
            {
              width: 60,
              fit:[60,60],
              image : ulbLogo,
              alignment:'left'
            },
            {
github egovernments / egov-services / web / react-pgr-web-v2 / src / components / non-framework / tl / transaction / RejectionLetter.js View on Github external
generatePdf = (ulbLogo, stateLogo, certificateConfigDetails, ulbName) => {

    var departmentName = certificateConfigDetails[CONFIG_DEPT_KEY];
    var license = this.props.license;
    var _this=this;

    //assigning fonts
    pdfMake.fonts = fonts;

    //document defintion
    var docDefinition = {
      pageSize: 'A4',
      pageMargins: [ 30, 30, 30, 30 ],
      content: [
        //Pdf header
        {
          columns: [
            {
              width: 60,
              fit:[60,60],
              image : ulbLogo,
              alignment:'left'
            },
            {
github egovernments / egov-services / web / react-pgr-web / src / components / non-framework / tl / transaction / PrintCertificate.js View on Github external
generatePdf = (ulbLogo, stateLogo, certificateConfigDetails, ulbName, receiptDetails) => {

  let license = this.props.license;

  var _this = this;

  var departmentName = certificateConfigDetails[CONFIG_DEPT_KEY];
  var municipalActDetails = certificateConfigDetails[CONFIG_MUNICIPAL_ACT_KEY];
  var receiptNumber = receiptDetails.Bill[0].billDetails[0].receiptNumber;
  var receiptDate = receiptDetails.Bill[0].billDetails[0].receiptDate;

  //assigning fonts
  pdfMake.fonts = fonts;

  //document defintion
  var docDefinition = {
    pageSize: 'A4',
    pageMargins: [ 30, 30, 30, 30 ],
    content: [
      //Pdf header
      {
        columns: [
          {
            width: 60,
            fit:[60,60],
            image : ulbLogo,
            alignment:'left'
          },
          {
github egovernments / egov-services / web / react-pgr-web / src / components / contents / pgr / notice / RejectionLetter.js View on Github external
generatePdf = (ulbLogo, stateLogo, ulbName) => {
    let {grievance} = this.props;

    let obj = grievance[0].attribValues.find(o => o.key === 'systemApprovalComments');

    var _this=this;

    //assigning fonts
    pdfMake.fonts = fonts;

    //document defintion
    var docDefinition = {
      pageSize: 'A4',
      pageMargins: [ 50, 30, 50, 30 ],
      content: [
        //Pdf header
        {
          columns: [
            {
              width: 60,
              fit:[60,60],
              image : ulbLogo,
              alignment:'left'
            },
            {
github OpenSlides / OpenSlides / client / src / app / core / pdf-services / pdf-worker.worker.ts View on Github external
function initPdfMake(data: any): void {
    pdfMake.fonts = {
        PdfFont: data.fonts
    };

    pdfMake.vfs = data.vfs;
}
github egovernments / egov-services / web / react-pgr-web-v2 / src / components / non-framework / tl / transaction / PrintCertificate.js View on Github external
generatePdf = (ulbLogo, stateLogo, certificateConfigDetails, ulbName, receiptDetails) => {

  let license = this.props.license;

  var _this = this;

  var departmentName = certificateConfigDetails[CONFIG_DEPT_KEY];
  var municipalActDetails = certificateConfigDetails[CONFIG_MUNICIPAL_ACT_KEY];
  var receiptNumber = receiptDetails.Bill[0].billDetails[0].receiptNumber;
  var receiptDate = receiptDetails.Bill[0].billDetails[0].receiptDate;

  //assigning fonts
  pdfMake.fonts = fonts;

  //document defintion
  var docDefinition = {
    pageSize: 'A4',
    pageMargins: [ 30, 30, 30, 30 ],
    content: [
      //Pdf header
      {
        columns: [
          {
            width: 60,
            fit:[60,60],
            image : ulbLogo,
            alignment:'left'
          },
          {
github egovernments / egov-services / web / react-pgr-web-v2 / src / components / non-framework / tl / transaction / Acknowledgement.js View on Github external
generatePdf = (ulbLogo, stateLogo, certificateConfigDetails, ulbName) => {
    let {license} = this.props;
    //assigning fonts
    pdfMake.fonts = fonts;

    //document defintion
    var docDefinition = {
      pageSize: 'A4',
      pageMargins: [ 30, 30, 30, 30 ],
      content: [
        //Pdf header
        {
          columns: [
            {
              width: 60,
              fit:[60,60],
              image : ulbLogo,
              alignment:'left'
            },
            {
github egovernments / egov-services / web / react-pgr-web-v2 / src / components / contents / pgr / notice / RejectionLetter.js View on Github external
generatePdf = (ulbLogo, stateLogo, ulbName) => {
    let { grievance } = this.props;

    let obj = grievance[0].attribValues.find(o => o.key === 'systemApprovalComments');

    var _this = this;

    //assigning fonts
    pdfMake.fonts = fonts;

    //document defintion
    var docDefinition = {
      pageSize: 'A4',
      pageMargins: [50, 30, 50, 30],
      content: [
        //Pdf header
        {
          columns: [
            {
              width: 60,
              fit: [60, 60],
              image: ulbLogo,
              alignment: 'left',
            },
            {