Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="Benetton_FRA.PrintPage" Location="CommandUI.Ribbon">
<CommandUIExtension>
  <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.Documents.Copies.Controls._children">
      <Button Id="Ribbon.Documents.Copies.PrintPage"
              Command="PrintPage"
              Sequence="15"
              Image16by16="/_layouts/images/Benetton_FRA/print16.gif"
              Image32by32="/_layouts/images/Benetton_FRA/print.gif"
              Description="PrintPage" LabelText="Print Page"
              TemplateAlias="o1"/>
    </CommandUIDefinition>
  </CommandUIDefinitions>
  <CommandUIHandlers>
    <CommandUIHandler
      Command="PrintPage"
      CommandAction="javascript:PrintPage();"
      EnabledScript="true"/>
  </CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
<CustomAction Id="Ribbon.Library.Actions.Scripts"
            Location="ScriptLink"
            ScriptSrc="/_layouts/Benetton_FRA/BenettonScripts.js" />
</Elements>

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

function PrintPage() {
    window.print();
}

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
add comment

1 Answer

up vote 1 down vote accepted

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

Update:
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.
Thanks.

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
add comment

Your Answer

 
discard

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.