How to save pdf on client after POST-Request?



  • I want to save my generated pdf from jsreportonline on the client. PDF is generated correclty, but how can I open it on the client?

       $http({
            url: url,
            method: "POST",
            headers: {
                'Authorization': 'Basic ' + auth,
                'Content-Type': 'application/json'
            },
            data: {
                "template": {"shortid": "S1L0FX2ZM"},
                "data": {"name": "showname", "age": "showAge"},
                "options": {
                    "reports": {
                        "save": true,
                    },
                    "Content-Disposition": "attachment; filename=myreport.pdf"
                }
            }
        }).then(function (response) {
            // save/show pdf on client
    
        });

  • administrators

    hi!, we have some logic in our browser sdk that handles the jsreport response and either download it in dialog or show it in iframe. here is the source code of the browser sdk maybe you get the idea of how to work with the response, but be sure to first read the docs of the browser sdk to get and idea on where to look in the source code


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.