1 Reply Latest reply on Nov 9, 2017 10:31 AM by carko RSS
    arosse Newbie

    How to print data (JSON) from ThingWorx?

    I would like to be able to print (physically, not PDF) a label from a ThingWorx mashup. The data I want to print is a table of values, so that could be presented inside a JSON object, looking like this for example:

    • Name: John Doe
    • Date: 2017/10/30
    • ID: 12345678

     

    As I did not find any built-in ThingWorx widget to do this, my first idea was to develop a custom widget "PrintButton". It would use the Print.js JavaScript library, allowing to print a JSON object from a web browser. As a new JavaScript user, I encounter difficulties to code this, as I can't find a way to make the runtime render work. Would someone have the source code of the button widget? It would help me start on a good basis.

     

    My first question is: is this a good approach, or should I rather develop a custom service in Java to do the print operation?

    My second question is: if this is a good idea, how to add an external JavaScript library to an extension Eclipse project?

     

    Thanks,

    Antoine