webapi.safeAjax({ type: "GET", url: "/_api/msevtmgt_events({{ request.params.id }})/musdyn_brochure", contentType:"application/json", success: function(res) { console.log(res); $('#main').append('<iframe src="data:application/pdf;base64,' + res.value + '" frameborder="0" height="100%" width="100%"></iframe>'); }, error: function(xhr, status, error){ var errorMessage = xhr.status + ': ' + xhr.statusText; console.log(errorMessage); } });