Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
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:
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
Hello, Antoine.
This post talk about how to parse JSON object data to get it into a ThingWorx service. It might serve point you in the right direction. Let us know if you have additional questions.
Thanks,
-- Craig A.