cancel
Showing results for 
Search instead for 
Did you mean: 

Print Action to Documents

linton
Champ in-the-making
Champ in-the-making
Hi All,
         I have been using alfresco for the past 6 months, I have defined few workflows as well.  Recently i have come across a new requirement, That is giving print options to documents which are attached to the workflow resource list.

For example, the user attached somefile to a workflow, and those files are listed in the Workflow resource list. There are option to view, download…Likewise , i am looking for a action to print.
I tried using javascript :window.print(). it prints only the html page, not the document.

Can anyone help me out with some ideas…


Thanks in advance..
2 REPLIES 2

iblanco
Confirmed Champ
Confirmed Champ
Unless you want to print a document whose content is text (xml, or html for example ) or a browser renderable content (for example a Image) i think it will be quite difficult.

When you exec window.print in the browser you are asking for the browser's print dialog to appear. This dialog renders the currently browsed content applying the corresponding CSS (the print media CSS if present) and prints it. So unless you manage to transform you content to HTML or a image if seems quite difficult to do what you want.

If your really have to do it, I would look into developing a transformation for your content type that transforms it to an image and then shows the image through a freemarker template that calls window.print().

Not an easy job I guess, good luck. If you manage to do something about this please share in this thread.

Thanks.

juilee
Champ in-the-making
Champ in-the-making
Hi all, I have a HTML document generated using JavaScript. I want to add a link to print the document or convert it to PDF using javascript in the same code. Is it possible?
I tried window.print() but the function is not recognized.
Thanks.