Skip to main content
1-Visitor
October 3, 2018
Solved

How to generate an PDF file

  • October 3, 2018
  • 1 reply
  • 4255 views

Hello everyone 

I am trying to create pdf file on button click event. For this I am  useing createPDF() function. its working fine but not as excepted because while i am passing any text file as input to this function it create one pdf but that pdf file having Image of that text file data. not actual data is there any why to create pdf without image as its data .....?

 

Thanks in advance 

 

Best answer by CarlesColl

CreatePDF generates a kind of Screenshot on the server side, all it's an Image. To generate a "real" PDF you will need another library and build your own extension, or use a third party PDF Generator server, or if it's at user request you can try a Javascript Browser library that can create the PDF at client side, something like: https://parall.ax/products/jspdf of course you will also need to create a UI ThingWorx Extension.

1 reply

1-Visitor
October 3, 2018

CreatePDF generates a kind of Screenshot on the server side, all it's an Image. To generate a "real" PDF you will need another library and build your own extension, or use a third party PDF Generator server, or if it's at user request you can try a Javascript Browser library that can create the PDF at client side, something like: https://parall.ax/products/jspdf of course you will also need to create a UI ThingWorx Extension.

RockLala1-VisitorAuthor
1-Visitor
October 3, 2018

Thanks for reply ...

Could you please help me into this how i can create / build custom Extension to full fill this requirement. which extra library i need ? 

 

Thanks 

1-Visitor
October 3, 2018

Here you have the Extension Developer Guide for ThingWorx: https://www.ptc.com/es/support/refdoc/ThingWorx_Platform/8.3/thingworx_extension_development_user_guide_170215

 

About selecting which Library/Approach to choose it's a project in itself.