How to use pdfmake - 10 common examples

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 / ui-web-app / src / development / pgr / lib / master / router / search.js View on Github external
import {Grid, Row, Col, Table} from 'react-bootstrap';
import {Card, CardHeader, CardText} from 'material-ui/Card';
import SelectField from 'material-ui/SelectField';
import AutoComplete from 'material-ui/AutoComplete';
import MenuItem from 'material-ui/MenuItem';
import RaisedButton from 'material-ui/RaisedButton';
import styles from '../../styles/material-ui';
import {Api, translate, DataTable} from 'egov-common-utility';

import $ from 'jquery';
import 'datatables.net-buttons/js/buttons.html5.js';// HTML 5 file export
import 'datatables.net-buttons/js/buttons.flash.js';// Flash file export
import jszip from 'jszip/dist/jszip';
import pdfMake from "pdfmake/build/pdfmake";
import pdfFonts from "pdfmake/build/vfs_fonts";
pdfMake.vfs = pdfFonts.pdfMake.vfs;

var _this;
var flag = 0;

const getNameById = function(source, id, text){
  // console.log(source, id, text);
  let type = source.find(x => x.id == id);
  // console.log(id, text);
  if(text){
    var value = text.split('.');
    if(value.length > 1){
      var obj={};
      return type ? type[value[0]][value[1]] : '';
    }else
      return type ? type[text] : '';
  }else{
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 schibsted / jsx-pdf / example / index.js View on Github external
// PDF to render
import PDF from './components/root';

// metrics
const start = Date.now();

try {
  console.log('Generating PDF...');

  // here's where the PDF is created
  const config = {
    copyrightYear: 2018,
  };

  const pdfMake = new PDFMake({
    OpenSans,
  });

  const stream = pdfMake.createPdfKitDocument(
    JsxPdf.renderPdf(),
  );

  // write the stream to a file; this could also be streamed to an HTTP connection, stdout etc
  stream.on('finish', () => console.log('PDF generated'));
  stream.pipe(fs.createWriteStream(path.resolve(__dirname, 'example.pdf')));
  stream.end();
} catch (err) {
  console.error('PDF generation failed');
  console.error(err);
} finally {
  // metrics
github egovernments / egov-services / web / react-pgr-web / src / components / non-framework / tl / search / NoticeSearchResult.js View on Github external
import React, {Component} from 'react';
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 'datatables.net-buttons/js/buttons.html5.js';// HTML 5 file export
import 'datatables.net-buttons/js/buttons.flash.js';// Flash file export
import jszip from 'jszip/dist/jszip';
import pdfMake from "pdfmake/build/pdfmake";
import pdfFonts from "pdfmake/build/vfs_fonts";
pdfMake.vfs = pdfFonts.pdfMake.vfs;

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);
  }
  componentWillUpdate() {
github egovernments / egov-services / web / ui-web-app / src / development / pgr / lib / master / serviceType / viewOrUpdateServiceType.js View on Github external
import React, {Component} from 'react';
import {connect} from 'react-redux';
import {Grid, Row, Col, Table} from 'react-bootstrap';
import {Card, CardHeader, CardText} from 'material-ui/Card';
import {Api, translate} from 'egov-common-utility';
import styles from '../../styles/material-ui';

import $ from 'jquery';
import 'datatables.net-buttons/js/buttons.html5.js';// HTML 5 file export
import 'datatables.net-buttons/js/buttons.flash.js';// Flash file export
import jszip from 'jszip/dist/jszip';
import pdfMake from "pdfmake/build/pdfmake";
import pdfFonts from "pdfmake/build/vfs_fonts";
pdfMake.vfs = pdfFonts.pdfMake.vfs;

var flag = 0;
var _this;

const getNameById = function(object, id, property = "") {
  if (id == "" || id == null) {
        return "";
    }
    for (var i = 0; i < object.length; i++) {
        if (property == "") {
            if (object[i].id == id) {
                return object[i].name;
            }
        } else {
            if (object[i].hasOwnProperty(property)) {
                if (object[i].id == id) {
github egovernments / egov-services / web / react-pgr-web-v2 / src / components / contents / pgr / master / escalation / bulkEscalationGeneration.js View on Github external
import FlatButton from 'material-ui/FlatButton';
import AutoComplete from 'material-ui/AutoComplete';
import RaisedButton from 'material-ui/RaisedButton';
import Chip from 'material-ui/Chip';
import DataTable from '../../../../common/Table';
import Api from '../../../../../api/api';
import styles from '../../../../../styles/material-ui';
import {translate} from '../../../../common/common';

import $ from 'jquery';
import 'datatables.net-buttons/js/buttons.html5.js';// HTML 5 file export
import 'datatables.net-buttons/js/buttons.flash.js';// Flash file export
import jszip from 'jszip/dist/jszip';
import pdfMake from "pdfmake/build/pdfmake";
import pdfFonts from "pdfmake/build/vfs_fonts";
pdfMake.vfs = pdfFonts.pdfMake.vfs;

var flag = 0;

const style = {
  chip: {
    margin: 4,
    cursor:'pointer'
  },
  wrapper: {
    display: 'flex',
    flexWrap: 'wrap',
  },
};

const getNameById = function(object, id, property = "") {
  if (id == "" || id == null) {
github egovernments / egov-services / web / react-pgr-web / src / components / contents / pgr / master / escalation / defineEscalation.js View on Github external
import SelectField from 'material-ui/SelectField';
import MenuItem from 'material-ui/MenuItem';
import AutoComplete from 'material-ui/AutoComplete';
import RaisedButton from 'material-ui/RaisedButton';
import DataTable from '../../../../common/Table';
import Api from '../../../../../api/api';
import styles from '../../../../../styles/material-ui';
import {translate} from '../../../../common/common';

import $ from 'jquery';
import 'datatables.net-buttons/js/buttons.html5.js';// HTML 5 file export
import 'datatables.net-buttons/js/buttons.flash.js';// Flash file export
import jszip from 'jszip/dist/jszip';
import pdfMake from "pdfmake/build/pdfmake";
import pdfFonts from "pdfmake/build/vfs_fonts";
pdfMake.vfs = pdfFonts.pdfMake.vfs;

var flag = 0;

const getNameById = function(object, id, property = "") {


  if (id == "" || id == null) {
        return "";
    }
    for (var i = 0; i < object.length; i++) {
        if (property == "") {
            if (object[i].id == id) {
                return object[i].name;
            }
        } else {
            if (object[i].hasOwnProperty(property)) {
github egovernments / egov-services / web / react-pgr-web-v2 / src / components / contents / pgr / master / serviceGroup / viewEditServiceGroup.js View on Github external
import React, {Component} from 'react';
import {connect} from 'react-redux';
import {Grid, Row, Col, Table} from 'react-bootstrap';
import {Card, CardHeader, CardText} from 'material-ui/Card';
import Api from '../../../../../api/api';
import styles from '../../../../../styles/material-ui';
import {translate} from '../../../../common/common';

import $ from 'jquery';
import 'datatables.net-buttons/js/buttons.html5.js';// HTML 5 file export
import 'datatables.net-buttons/js/buttons.flash.js';// Flash file export
import jszip from 'jszip/dist/jszip';
import pdfMake from "pdfmake/build/pdfmake";
import pdfFonts from "pdfmake/build/vfs_fonts";
pdfMake.vfs = pdfFonts.pdfMake.vfs;

var flag = 0;

var _this;

class ViewEditServiceGroup extends Component {
    constructor(props) {
      super(props);
      this.state = {
        data:'',
        modify: false
      }
    }

    componentWillMount() {
    }
github egovernments / egov-services / web / ui-web-app / src / development / inventory / lib / common / components / CustomUiTable.js View on Github external
// require('datatables.net-buttons/js/buttons.colVis.js'); // Column visibility
// require('datatables.net-buttons/js/buttons.html5.js'); // HTML 5 file export
// require('datatables.net-buttons/js/buttons.flash.js'); // Flash file export
// require('datatables.net-buttons/js/buttons.print.js'); // Print view button

import $ from 'jquery';
import 'datatables.net-buttons/js/buttons.html5.js';// HTML 5 file export
import 'datatables.net-buttons/js/buttons.flash.js';// Flash file export
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.flash.js';
import 'datatables.net-buttons-bs';


pdfMake.vfs = pdfFonts.pdfMake.vfs;

var enumWithUnderscore = [{
	propertyName: "rateType"
}]

class CustomUiTable extends Component {
	constructor(props) {
       super(props);
       this.state = {};
  }

  componentWillUnmount() {
			if($.fn.DataTable.isDataTable('#searchTable')) {
    		$('#searchTable').DataTable().destroy(true);
		  }
  }
github egovernments / egov-services / web / react-pgr-web / src / components / contents / pgr / master / escalation / bulkEscalationGeneration.js View on Github external
import FlatButton from 'material-ui/FlatButton';
import AutoComplete from 'material-ui/AutoComplete';
import RaisedButton from 'material-ui/RaisedButton';
import Chip from 'material-ui/Chip';
import DataTable from '../../../../common/Table';
import Api from '../../../../../api/api';
import styles from '../../../../../styles/material-ui';
import {translate} from '../../../../common/common';

import $ from 'jquery';
import 'datatables.net-buttons/js/buttons.html5.js';// HTML 5 file export
import 'datatables.net-buttons/js/buttons.flash.js';// Flash file export
import jszip from 'jszip/dist/jszip';
import pdfMake from "pdfmake/build/pdfmake";
import pdfFonts from "pdfmake/build/vfs_fonts";
pdfMake.vfs = pdfFonts.pdfMake.vfs;

var flag = 0;

const style = {
  chip: {
    margin: 4,
    cursor:'pointer'
  },
  wrapper: {
    display: 'flex',
    flexWrap: 'wrap',
  },
};

const getNameById = function(object, id, property = "") {
  if (id == "" || id == null) {