A
A
ascart2016-06-28 17:41:22
JavaScript
ascart, 2016-06-28 17:41:22

What is the best way to implement automatic PDF printing in ie8?

Dear, please tell me - you need to implement the following case:
The user clicks on the Print button The
loader is launched blocking the work with the form The
request to the REST service with custom headers (important), the service returns PDF The
automatic printing of the received PDF is launched The
loader is closed
This should work in ie8
Now similar implemented using activeX pdf.ocx from Adobe Acrobat - but it is extremely primitive, does not contain a callback to the end of the rest loading (there is no way to close the loader correctly), cannot add custom headers

...
const print= '<OBJECT CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000"'
    + 'id="' + uid + '" width="0" height="0" >'
    + '<PARAM NAME="src" VALUE="' + url + '">'
    + '</OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', print);
const doc = document.getElementById(uid);
doc.contentDocument.printAll();

Are there any good solutions how to do this? This, again, should work in ie8 and ie11 in ie8 mode...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question