Community Forum

Factory.Print

Profile Image 4 Posts 4 Karma
Talias posted this 13 January 2015

Hi,

Is there a way of determining the printer the user has selected when factory.print is used?

I've used onbeforeprint and onafterprint as an opportunity to report the factory.currentPrinter, but this simply reports the default printer, or the previous printer used rather than the user's choice when printing.

Will it be necessary to build a custom print dialog to achieve this?

Thanks,

Profile Image 23 Posts 23 Karma
Admin
petecole posted this 14 January 2015

Hi,

I presume you mean prompted printing. Logically it does make sense that factory.currentPrinter will return the printer they used. We'll look into why this isnt happening.

Thanks

Pete Cole
MeadCo.

Profile Image 4 Posts 4 Karma
Talias posted this 15 January 2015

Yep, we have the prompt parameter set to true.

Thanks for investigating.

 

Profile Image 189 Posts 189 Karma
Jerry posted this 15 January 2015

I just had a quick test with our 'PrintSetup()'

 

function initView() {
 if (factory.printing.printSetup() == true) {
         alert(factory.printing.CurrentPrinter);
         factory.printing.Print(false);
         factory.printing.WaitForSpoolingComplete();
         // do something else such as navigate the content frame      
 }
 else {
  // They failed to choose a printer, let's get out of here
  alert("Print operation has been aborted...");
 }
}

 

That returns the selected printer each time, so maybe that's your solution.

 

Jerry

Post Edited 15 January 2015

Profile Image 4 Posts 4 Karma
Talias posted this 16 January 2015

Yes, by separating the setup dialog I can get the printer selected by the user.

This gives us what we need.

Thank you!

Profile Image 189 Posts 189 Karma
Jerry posted this 16 January 2015

I forget to ask the version of ScriptX that you were originally reporting against.

 

Tx

Profile Image 4 Posts 4 Karma
Talias posted this 19 January 2015

Sure, it's version 7.5.0.20.

(Unrelated note - I recently downloaded the installer from the ScriptX site but found I needed to rename the msi file to smsxw.msi for the installer to work. After that the installation ran fine.)

 

Profile Image 189 Posts 189 Karma
Jerry posted this 19 January 2015

OK, thanks for all that.

 

J.