Skip to content

Instantly share code, notes, and snippets.

@PeteGCole
Last active December 21, 2016 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PeteGCole/4fc25ae03e8eb9a4a411b026190ff504 to your computer and use it in GitHub Desktop.
Save PeteGCole/4fc25ae03e8eb9a4a411b026190ff504 to your computer and use it in GitHub Desktop.
// Whether duplex is supported can be checked in one of two ways:
// These rely on the driver correctly reporting that it doesnt support duplex.
// 1. catch the error that occurs when trying to set duplex
try {
factory.printing.duplex = 2;
} catch (e) {
// duplex isnt supported, will need to be manual
}
// 2. use duplex2. 0 is returned if not supported
// (http://scriptx.meadroid.com/knowledge-bank/technical-reference/printing-factoryprinting/duplex2.aspx)
if ( !factory.printing.duplex2 ) {
// duplex isnt supported, will need to be manual
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment