Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    snrkannan
    @snrkannan
    Thank you so much.. looks like its working now. Once again thanks for your valuable time... :)
    Simon Bengtsson
    @simonbengtsson
    No worries!
    snrkannan
    @snrkannan

    Hi sorry to disturb again..

    Im facing some weird issue im not sure why,Kinldy help me,
    Issue 1:
    Fisrt time generatePdf generated the pdf properly
    Second time when i hit the generatepdf its throws following error

    Error: Mismatched anonymous define() module: function (){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r);}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(dereq,module,exports){
    (function (global){
    /! http://mths.be/punycode v1.2.4 by @mathias /
    (function(root) {

    /** Detect free variables */
    var freeExports = typeof exports == 'object' && exports;
    var freeModule = typeof module == 'object' && module &&
        module.exports == freeExports && module;
    var freeGlobal = typeof global == 'object' && global;
    if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
        root = freeGlobal;
    }
    
    /**
     * The `punycode` object.
     * @name punycode
     * @type Object
     */
    var punycode,
    
    /** Highest positive signed 32-bit float value */
    maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
    
    /** Bootstring parameters */
    base = 36,
    tMin = 1,
    tMax = 26,
    skew = 38,
    damp = 700,
    initialBias = 72,
    initialN = 128, // 0x80
    delimiter = '-', // '\x2D'
    
    /** Regular expressions */
    regexPunycode = /^xn--/,
    regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars
    regexSeparators = /\x2E|\u3002|\uFF0E|\uFF61/g, // RFC 3490 separators
    
    ......
    
    Third time hit the generatePdf it genereate pdf properly,
    Issue 2:
    Sometime its throws an error saying  
    TypeError: doc.autoTable is not a function
    Simon Bengtsson
    @simonbengtsson
    Try this: MrRio/jsPDF#989
    Simon Bengtsson
    @simonbengtsson
    Okay! Is the problem still there after you comment out your usage of jspdf-autotable?
    snrkannan
    @snrkannan
    yes only after including the jspdf-autotable..
    if i comment out i didn't face any issue..
    Im sorry without jspdf.debug.js and jspdf.plugin.autotable My application working properly,
    snrkannan
    @snrkannan
    but if i included those 2 js im getting that error
    Simon Bengtsson
    @simonbengtsson
    How about if you only include jspdf?
    snrkannan
    @snrkannan
    its says getStringUnitWidth is not found
    Simon Bengtsson
    @simonbengtsson
    on what line?
    snrkannan
    @snrkannan

    TypeError: config_1.Config.tableInstance(...).doc.getStringUnitWidth is not a function

    var width = config_1.Config.tableInstance().doc.getStringUnitWidth(line);

    Line 313
    I hope you are talking about jspdf.js not on jspdf.debug.js
    Simon Bengtsson
    @simonbengtsson
    Hmm, I might have an idea what is wrong
    One se
    c
    snrkannan
    @snrkannan
    ok
    Simon Bengtsson
    @simonbengtsson
    Nope, that was not the issue. Can you create a minimal verifiable example and see if the issue still persist. If it does you can post that issue here and I'll take a look.
    snrkannan
    @snrkannan
    yeah sure, i will try
    Thank you so much for your time
    Simon Bengtsson
    @simonbengtsson
    No worries
    snrkannan
    @snrkannan

    Hi,When i run the example file https://github.com/simonbengtsson/jsPDF-AutoTable/tree/master/examples/requirejs/index.html ,itlself throwing the error

    TypeError: doc.autoTable is not a function
    doc.autoTable(columns, data);

    error line 14 .. Ps: Im running all these in Mozilla Firefox

    snrkannan
    @snrkannan
    is it possible to merge the jsPDF-AutoTable to jspdf-debug or is there anything done already
    Simon Bengtsson
    @simonbengtsson
    Why do you want to merge them? You could bundle them together with browserify or webpack.
    snrkannan
    @snrkannan
    when i create a sample plugin inside the jspdf-debug that method get listed, but not from autotable plugin
    Also that particular issues TypeError: doc.autoTable is not a function not showing everytime
    I occurs randomly
    i have no clue what to do
    snrkannan
    @snrkannan
    im Using require js in my application,Im not sure how to use either of them, TypeError: doc.autoTable is not a function
    Kindly help me
    Simon Bengtsson
    @simonbengtsson
    Could you create a mcve and post it here? Have you looked at the requirejs example in the examples folder?
    snrkannan
    @snrkannan
    With the help of requirejs only i created, i trying to create mcv to replicate the issue, but the problem is it is not a replicating, im not sure what i did wrong in my application, All i have in my project is

    This is how i defined it
    index.html

    <script src="./jslib/require/require_2.3.3.js" data-main="js/app/config/config"></script>

    config.js

    require.config({
    baseUrl : "/test/",
    waitSeconds : 160,
    // Define
    paths : {
    "text" : "jslib/require/text",
    "jquery" : "jslib/jquery/jquery-min-2.2.4",
    "underscore" : "jslib/backbone/underscore-1.8.3",
    "backbone" : "jslib/backbone/backbone-1.3.3",
    "marionette" : "jslib/backbone/backbone.marionette-2.4.7",
    "bootstrap" : "jslib/bootstrap/bootstrap-3.3.7",
    "bootstrap-select" : "jslib/bootstrap/bootstrap-select",
    "validation" : "jslib/backbone/backbone-validation-min",
    "stickit" : "jslib/backbone/backbone.stickit-0.9.2",
    "jsnlog" : "jslib/jsnlog/jsnlog-2.7.11",
    "backbone.paginator" : "jslib/backbone/backbone.paginator",
    "backgrid-filter" : "jslib/backgrid/backgrid-filter",
    "backgrid" : "jslib/backgrid/backgrid",
    "backgrid-paginator" : "jslib/backgrid/backgrid-paginator",
    "backgrid-resizecolumns" : "jslib/backgrid/backgrid-sizeable-columns",
    "backgrid-ordercolumns" : "jslib/backgrid/backgrid-orderable-columns",
    "backgrid-group-columns" : "jslib/backgrid/backgrid-grouped-columns",
    "jquery-ui" : "jslib/jquery/jquery-ui.min",
    "bootstrap-tagsinput" : "jslib/bootstrap/bootstrap-tagsinput",
    "backgrid-responsiveGrid" : "jslib/backgrid/backgrid-responsiveGrid",
    "jquery-layout" : "jslib/jquery/jquery-layout",
    "bootstrap-datepicker" : "jslib/bootstrap/bootstrap-datepicker",
    "bootstrap-notify" : "jslib/bootstrap/bootstrap-notify",
    "multiselect" : "jslib/bootstrap/multiselect",
    "typeahead" : "jslib/typeahead/typeahead.bundle",
    "cropper" : "jslib/cropper/cropper",
    "chosen" : "jslib/chosen/chosen.jquery",
    'jspdf' : 'jslib/pdf/jspdf.debug',
    'jspdf-autotable' : 'jslib/pdf/jspdf.plugin.autotable'

    },
    // Sets the configuration for your third party scripts that are not AMD
    // compatible
    shim : {
        // Twitter Bootstrap jQuery plugins
        "bootstrap" : ["jquery", "jquery-ui"],
        "underscore" : ["jquery"],
        // Backbone and Marionette
        "backbone" : {
            "deps" : ["jquery", "underscore"],
            "exports" : "Backbone"
        },
        "marionette" : {
            "deps" : ["jquery", "underscore", "backbone"],
            "exports" : "Marionette"
        },
        "validation" : {
            "deps" : ["jquery", "backbone"],
            "exports" : "Validation"
        },
        "stickit" : ["jquery", "underscore", "backbone"],
        "backgrid" : ["jquery", "underscore", "backbone"],
        "backgrid-paginator" : ["backgrid"],
        "backgrid-resizecolumns" : ["backgrid"],
        "backgrid-ordercolumns" : ["backgrid"],
        "backgrid-group-columns" : ["backgrid"],
        "backgrid-responsiveGrid" : ["backgrid"],
        "jquery-ui" : ["jquery"],
        "jquery-layout" : ["jquery", "jquery-ui"],
        "bootstrap-tagsinput" : ["jquery", "bootstrap"],
        "bootstrap-notify" : ["jquery", "bootstrap"],
        "multiselect" : ["jquery", "bootstrap"],
        "typeahead" : {
            "deps" : ["jquery"]
        },
        "chosen" : {
            "deps" : ["jquery"]
        }
    
    },
    // Invoke the Init.js
    deps : ["..."]

    });

    ReportUtils.js
    define(
    ["jsPDF", "jspdf-autotable"],
    function(jsPDF)
    {
    var ReportUtils = {
    generatePDF : function(options)
    {
    var doc = new jsPDF('p', 'pt', 'a4');

                doc.autoTable(columns, data, {
                    startY : 75,
                    addPageContent : headerFooter,
                    margin : {
                        top : 75,
                        bottom : 30,
                        horizontal : 7
                    },
                    bodyStyles : {
                        valign : 'top'
                    },
                    styles : {
                        overflow : 'linebreak',
                        columnWidth : 'wrap'
                    },
                    columnStyles : columnStyles
                });
                // Total page number plugin only available in jspdf v1.0+
                if (typeof doc.putTotalPages === 'function')
                {
                    doc.putTotalPages(totalPagesExp);
                }
                doc.save("test.pdf");
                this.trigger("close");
            }    };
    
        return ReportUtils;
    });
    Simon Bengtsson
    @simonbengtsson
    Did you try removing things until the problem disappear as recommended ok m
    in the link above*
    snrkannan
    @snrkannan
    Im sorry which link...
    :(
    Am i doing anything wrong,
    snrkannan
    @snrkannan
    I dont think its a code issue, something else should be wrong... but dont know what and where to check.... :worried: :worried: :worried: :worried: :worried:
    Simon Bengtsson
    @simonbengtsson
    If I were to debug your issue I would remove one code line at a time or one dependency at a time until the problem disappeared as recommended in the webpage about mcve above.
    snrkannan
    @snrkannan
    i just notice, when i clear the cache (options-Advanced-Under Network tab-Clear cache(Mozilla Firefox)) it started to working properly some times.. is this kind of browser issue..
    Saurabh Upadhyaya
    @saurabhgis
    is Arabic/Urdu support issue resolved?
    Simon Bengtsson
    @simonbengtsson
    Don't think so, but check the utf-8 issue in the jspdf repository
    vishyagnik2186
    @vishyagnik2186
    is utf-8 character supported in jspdf-autotable ? i am trying to export arabic words from html table to pdf with this plugin
    Saurabh Upadhyaya
    @saurabhgis
    @vishyagnik2186 Its not supported. We also want to export html to pdf(arabic). Is any open source available for the same.
    Simon Bengtsson
    @simonbengtsson
    Try pdfmake that is based on pdfkit
    bgomes90
    @bgomes90
    Hello, how i get total number of pages?
    var totalPagesExp = "{total_pages_count_string}"; doesnt work