Community Forum

Error Printing of the previous document is still in progress

Profile Image 2 Posts 2 Karma
jbc posted this 24 September 2013

Invoking factory.printing.Print to print a frame via a button in a html page, the first printing (sometimes more) is ok, then I’m getting javascript error ‘Printing of the previous document is still in progress’ and the button hangs till I close the page and reopen-it. This happens with XP, IE8 and ScriptX 7.2.0.36. With XP, IE7 and ScriptX 6.1.430.5 is working fine. I’m using the free ScriptX. I need to migrate to IE8 and any help will be appreciated.

 

Object declaration in body section:

 

<!-- MeadCo ScriptX Control -->

<object id="factory" style="display:none" viewastext

classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814">

</object>

 

//javascript function invoked to print frame

function sellar()

{

            factory.printing.header = "";

            factory.printing.footer = "";

            factory.printing.topMargin = 0;

            factory.printing.leftMargin = 0;

            factory.printing.rightMargin = 0;

factory.printing.Print(form1.dialogoimpresora.checked, frmsello);

return true;

}

Profile Image 189 Posts 189 Karma
Jerry posted this 24 September 2013

Hi

 

In licensed use we've got a switch - WaitForSpoolingCompete() - which you can use to controil when it's safe to navigate away from the content under print, or close the browser.

 

In 'free' use you need a timeout of suitable length, after the print call and before the next navigation.

Post Edited 24 September 2013

Profile Image 2 Posts 2 Karma
jbc posted this 25 September 2013

Time delay doesn't seem to be the problem. I do the firts print ok, then, I can wait any time before clicking the button again, and still I get the error.

Profile Image 189 Posts 189 Karma
Jerry posted this 25 September 2013

Something 'thinks' that spooling isn't complete ... you just need to work out what.

 

BTW, are you quite sure about the arguments you're feeding to Print? Correct syntax

 

  factory.printing.Print(true|false, window|frameName);

 

And what is this for:

 

  return true; ?

 

That doesn't help. Think about what's happening after your call to Print, and try to get that sequence under control.

 

For printing of framed content, we would usually recommend that the ScriptX object appeared on ther topmost (i.e. the frames' host) doc and was called up to there on 'top'.