SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating some custom features to add functionality to the ribbon.

I have created a button to print the page you are viewing very easily like that:

SPItem containing elements.xml:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="">
  <CustomAction Id="Benetton_FRA.PrintPage" Location="CommandUI.Ribbon">
    <CommandUIDefinition Location="Ribbon.Documents.Copies.Controls._children">
      <Button Id="Ribbon.Documents.Copies.PrintPage"
              Description="PrintPage" LabelText="Print Page"
<CustomAction Id="Ribbon.Library.Actions.Scripts"
            ScriptSrc="/_layouts/Benetton_FRA/BenettonScripts.js" />

JS file with the JS method to invoke for the page print:

function PrintPage() {

function enable() {
   var items = SP.ListOperation.Selection.getSelectedItems();
   var itemCount = CountDictionary(items);
   return (itemCount > 0);

Everything works fine. Now I must do the same thing for files: I select one file and this had to be printed. Is there something in EMCS Script that allows me to open and print a file? Is there any server side command to do that?

Thank you very much!

share|improve this question
up vote 1 down vote accepted

have you found the solution?
I am also facing the same challenge.

I am facing same problem but I am able to print. Please refer This Link

Hope this link will help others too. Please let me know if you can explore more.

share|improve this answer
This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. – Mike May 8 '13 at 14:41
Thanks @Mike. I have updated my Answer. – MAK May 8 '13 at 14:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.