Hello,

I need to know this one. How can we get printer status using JavaScript and also how can we give MS word document print command using JavaScript.

Recommended Answers

All 3 Replies

perhaps not a direct answer but to determine if the local pc

  • has an application that can read the particular version .doc file you intend to print
  • has a printer
  • has security settings that allows scripts to take over their hardware (MALWARE ALERT)

it would be better to output the .doc as html then printing is easy

Hi bob,

Thank you for your suggestion. But my client requirement is to print a word doc. He need a printer management system. The client has a Local Area Network in his infrastructure, where his students make word document and those documents are to be printed.

The doc should be validated before it is printed (doc should meet prerequisite page settings). When the document is page setting meets the prerequisite, the system should send the document to the printer...

That system also should get the status of the printer. Depending upon the printer status the system should change its functionality.

So, I need JScript that could:

1)Get printer status(out of paper, ready and printing)
2)Read doc page settings(number of pages, page size and margins)
3)Finally, give doc print command

perhaps not a direct answer but to determine if the local pc

  • has an application that can read the particular version .doc file you intend to print
  • has a printer
  • has security settings that allows scripts to take over their hardware (MALWARE ALERT)

it would be better to output the .doc as html then printing is easy

I don't think you can do that with JS. For security reason, JS should not be able to deeply touch inside client's PC. A website shouldn't be able to force your PC to print all your doc, or shutdown your PC.

You may try to use server side script such as PHP. PHP is able to communicate with COM and working with Word documents.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.