SharePoint 2013 Print Library Item Automatically

g_currier
g_currier used Ask the Experts™
on
While I have found the information I need to develop event handling for a specific list or library, what I have not found is a method to send the document (already converted to PDF) to a printer.  I have no idea where to start with this, though I am almost sure that it will involve building a custom printing service running on the host O/S (Windows Server 2012r2)...

Can anyone provide me ideas or at least a "where to look" reference? (I have no experience with building services)

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2013
Awarded 2012
Commented:
Hi,
question: when should the file be printed?
On creation, by user action, scheduled ...?

If possible, I would suggest a scheduled solution, utilizing a PowerShell script which downloads the files based on the creation / last modified date and then prints the file - e.g. like mentioned here:
https://gregcaporale.wordpress.com/2012/01/18/powershell-to-print-files-automatically/

Should be the easiest way - no SharePoint customization necessary, script will use Client Object Model or simple Web Requests to get the content, it can run on any server ...

Just my 2 ct
Rainer

Author

Commented:
Right...sorry I forgot to include the "when" part... it would essentially be when the document (the PDF) is checked in to a document library.  I could use a scheduled Powershell task to read the library and then download the file and print it...does that sound about right? Is it necessary that the file sits in a folder first?
Most Valuable Expert 2013
Awarded 2012

Commented:
Hi,
yes, that sound right.
I am not sure if the PowerShell command can work with the WebDAV connected files and it might be hard to filter the files (I guess you do not want to print each and every file everytime) - therefore running a SharePoint query on the library returning only the necessary (affected) documents to a local folder and then running the print in a loop on the local files would be my suggested solution.

HTH
Rainer
Jamie McAllisterCloud Expert
Most Valuable Expert 2013
Top Expert 2014

Commented:
I'm with Rainer on this one, if you can get away with a batch process it'll be a nicer approach. You should architect it as detailed here;

http://the-north.com/sharepoint/post/Alternatives-to-SharePoint-Timer-Jobs

If it has to be real time then you probably need to code an event receiver, or workflow to handle the passing over to another unattended service for printing. (But seriously I'd keep the code off the SharePoint servers if at all possible. Your custom task could poll for new content every ten minutes rather than going for a full synchronous process?)

Windows Services tend to be overkill for this sort of thing. Task scheduler running a simple console app is usually a better approach, more robust and much less code.

Just a thought but to decouple this a little without using an event receiver or regular polling etc you could actually set up an alert on the library and send the alert emails to the print process you create (as the emails should contain the info you need to find the items that need printing).

Author

Commented:
Thanks for the tip...I am implementing this and beginning my testing.  Now...to read the print queue...lol

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial