0 Replies Latest reply: Nov 18, 2015 11:00 AM by Anders Uddenberg RSS

    Generate snapshot image programmatically

    Anders Uddenberg

      I'm trying to generate a snapshot programmatically, just like Qlik Sense is doing when I right click and select "Export as image".


      What I've found is that I need to send a request to: 'http://localhost:9902/printing/export/object/image?requestId=92796cf5-2d7f-4a07-973d-2c843fc21a2a' using jQuery.


      Data neccessary with this request is:

      data: JSON.stringify({"imageType" : "Png", "captureSize":{"width":482,"height":472,"dpi":92}, "objTree": {"id":"fzrxtjq","type":"scatterplot","area":{"left":0,"top":0,"width":1,"height":1}, "children":[],"isExtension":false,"snapshotData":"N4IgJghklajsdkjsdkjsd.............."}}),


      There is an id in there (fzrxtjq) but what I have two questions


      Question 1:

      How do I generate or get a requestId (eg 92796cf5-2d7f-4a07-973d-2c843fc21a2a)


      Question 2:

      the snapshotData looks like it's a base64 encoded string but it's not. How do I generate this string?