Skip to content

jspdf does not report its version id #2137

@bwl21

Description

@bwl21

Thank you for submitting an issue to jsPDF. Please read carefully.

Are you using the latest version of jsPDF?
using commit 2c35e16

Have you tried using jspdf.debug.js?

yes

Steps to reproduce

alert(jsPDF.version)

What I saw

undefined

What I expected

the version number

Solution proposal

this issue comes from the fact that jspdf.line

  jsPDF.version = ("${versionID}" === ("${vers" + "ionID}")) ? "0.0.0" : "${versionID}";

is executed by the bundler and therefore the placeholder is replaced by 0.0.0. I propose simply put the placeholder here.

  jsPDF.version = "${versionID}";

I furtheron propose to take the versionID from git describe

This could be done in build.js line 89

  var version = execSync('git describe').toString().trim()

maybe it makes sense to patch package.json in build.js as well. The advantage is clear: no double maintenance of version numbers!

as a pity index.html is distorted when the version string is too long. The upper right part needs to be recoded such that it is more robust, e.g. like this:

screenshot_1290

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions