Capture a portion of screen as displayed in UI and save as an Image Object in Mendix DB

0
Hello Team,   My basic requirement is to capture(screenshot) some detail on screen and create a pdf document out of it which can be downloaded by end users. (Both Graphical and Text Data) @ My page involves complex graphs and texts which is why I cannot go with the Mendix Document Template. Tried using “PrintScreen To PDF”. It renders only texts and basic charts. Complex Graphs such as Chord Graph comes as blank. Tried using “Templator”. I have to recall the page and re-render the graph which consumes time.   My App involves complex graphs like the one shown below. It would be best if I can just screenshot this graph from browser and store in Mendix DB and then use as a dynamic image in my Document Template to create PDF documents. Have been scratching my head around this one for quite some time. Require your help!  
asked
3 answers
0

Hi,

 

I assume you want to do this based on a action microflow with minimum of manual activities? Do you use the AnyChart widget for the charting?

 

Regards,

 

Andre

answered
0

What JavaScript library do you use to create the graph? What format is your graph? SVG? Exporting an image of a graph is available in most complex charting libraries. So, that is your best bet.
Else, I think the ‘Printscreen to PDF’ widget could be an option still. It uses an outdated version of a JavaScript library that takes care of the rendering of the image. You could try and see if the format you render is supported in a newer version of the library this widget uses?

 

answered
0

Sadly it is not possible to use widgets inside the Mendix document template. As Ivo Sturm wrote, there is a Printscreen to PDF widget https://marketplace.mendix.com/link/component/27069 and the Templator (which afaik needs a license) https://marketplace.mendix.com/link/component/114043

You can also try to use browser print but be warned that it is a hassle to get it to work on different browsers, page orientations..

answered