[Answer]-Browser requests file, server downloads pdf, browser displays pdf in iframe


Probably what you meant was simply:

var uri = '/viewer/loaddrawing/';
document.getElementById('iframetitle').src = uri + '?key=' + value;

There is no JSON involved, so the iframe will get a PDF directly. However, notice that the client must have a PDF-viewer plugin, otherwise the browser will ask for a download prompt.

Leave a comment