1

I am using OpenXML to open a .dotx file, create a Word document, do some text substitution and then save the document. However, my client would ideally like the document sent directly to the printer without any user involvement; ideally, the user would press a PRINT button on the view, which would call a Controller method (via vue.js) and have the document appear at the printer. I can't see any obvious way to do this and I'd prefer, if possible, not to use 3rd party libraries (free open-source libraries are fine, but there's no budget)

Edwardo
  • 872
  • 1
  • 11
  • 24
  • How will you let a document that exists on your web server roll out of the user's printer? Will they even have an OpenXML-supporting text editing application installed? – CodeCaster Oct 12 '20 at 09:48
  • The final document is just a Word document (.docx) which is created and finalised inside the Controller method (I've written this and returned the document to the browser). The user can easily open the downloaded document and print it locally, but the client would like this done automatically without user input. Of course, you highlight a major flaw in their/my thinking, which is that the code is executed on the server but they want the output at the client. – Edwardo Oct 12 '20 at 13:25
  • Yes, that's the problem. The closest you could come is to return a page that contains a PDF view of said Word document and a bit of JavaScript that opens the print dialog. – CodeCaster Oct 12 '20 at 13:42
  • Or, if it's an internally hosted site, you could look into automating printing to a network server of the user's choosing. – CodeCaster Oct 12 '20 at 13:43

0 Answers0