Skip to main content
Mar 5, 2019 6:24 AM UTC
Answered

Silent printing in IE using activeX

Hello

I'm trying to pritn using adobe acrobat activeX

here is my code

<!DOCTYPE html>

<html>

<head>

    <title>Print Test</title>

    <meta charset="utf-8" />

    <script>

        function startPrinting() {

          

  

        var acrobatObj = document.createElement('object');

        acrobatObj.width = '500';

        acrobatObj.height = '500';

        acrobatObj.classid = 'clsid:CA8A9780-280D-11CF-A24D-444553540000';

document.body.appendChild(acrobatObj)

acrobatObj.src = 'test.pdf';

            window.setTimeout(

                function () {

                    acrobatObj.print();

                }, 1000);   // how big timeout?

        }

        window.onload = startPrinting;

    </script>

</head>

<body>

<div id="ext-gen289"></div>

</body>

</html>

It works nicelly

Now the question- if user has low bandwidth, the setTimeout to 1 second is not enough.

In fact soem of users need to wait 1 minute to donlload respective file. While the others on stronger network, can print normally withoin one second

Is there a wya how the activeX would notify me "i have whole content"

I tried to play with cache, cookies sent prom the server, buffered reponse or session with no luck so far

Thanks

Zdenek

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Mar 7, 2019 5:42 PM UTC

What I mean is add the printing code to a doc-level function of the PDF, like this:

this.print();

That way, when the file is opened (in a viewer that supports scripts correctly), the print dialog will immediately appear.

12 replies

try67
Community Expert
Community Expert
Mar 7, 2019 4:46 PM UTC

Try embedding the code in the actual file, instead of doing it via the HTML page.

Translate
Mar 7, 2019 4:52 PM UTC

Hello

what you mean by "embedding the code in the actual file"
I need to print from browsers (our app is in the browser, above is simplifed example)

How would that explain that it works in FF/Chrome and not in IE?

Thanks

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Mar 7, 2019 5:42 PM UTC

What I mean is add the printing code to a doc-level function of the PDF, like this:

this.print();

That way, when the file is opened (in a viewer that supports scripts correctly), the print dialog will immediately appear.

Translate