Print form node

196 views
Skip to first unread message

Lincoln Lemos

unread,
Feb 5, 2014, 1:57:15 PM2/5/14
to nod...@googlegroups.com
How i can print automatically with node from front-end?

I found a module (Ipp - internet print protocol ).
This help me start a communication with the printer, but i can not do with this from front-end.

Someone have any idea?

--
Lincoln Lemos
62 81998667

Mark Hahn

unread,
Feb 5, 2014, 2:33:44 PM2/5/14
to nodejs
We output PDFs which can be easily printed.  I'm not aware of any other way that any user can print.


--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

q2dg2b

unread,
Feb 5, 2014, 6:48:34 PM2/5/14
to nod...@googlegroups.com
Maybe this can help you? https://gist.github.com/vodolaz095/5325917 (only in Unix)

William Wicks

unread,
Feb 5, 2014, 6:56:03 PM2/5/14
to nod...@googlegroups.com
According to the issue he opened on my IPP project (https://github.com/williamwicks/ipp/issues/3), he is trying to print directly from the browser without a server.

Someone else suggested, to me, that using Google cloud print might be a solution- however, I think his requirements are that he wants endusers to print without using the print dialog or needing to do any setup.
I made my best guesses as to how that would play out in the issue thread.
Lincoln, maybe you can clarify if I summarized it correctly?

-William Wicks


On Wed, Feb 5, 2014 at 3:48 PM, q2dg2b <q2d...@gmail.com> wrote:
Maybe this can help you? https://gist.github.com/vodolaz095/5325917 (only in Unix)

zladuric

unread,
Feb 6, 2014, 4:26:22 AM2/6/14
to nod...@googlegroups.com
That module looks like it is made node into a print server.

What exactly do you mean, print from the frontend? Click on the 'print' button? Where does this action print: to your printer attached to the node's server? Or to the users' printer?

Because if it's the former, it's in the modules' examples and readme page. I'd use this module to discover printers on wakeup. Then once I get a request from 'frontend' to do some printing, use this module to send it a print job.


If it's the later, then node is of no help, I think - unless you're doing something like node-webkit, which is a client side app.

Lincoln Lemos

unread,
Feb 6, 2014, 7:20:43 AM2/6/14
to nod...@googlegroups.com
@William
Yes. Is this.
So far, with the knowledge I have about Node, this was the way I could think to build the project. 

The idea is to make an application to receive subscriptions from Instagram in real time and apply my custom layout. Ideally generate a jpeg and send to the printer, but I still could not get a way to generate this gif. 

What I've been reading that was accurate phantom.js to generate the jpeg. The problem is that the phantom I need a url, and in my case I am generating the layout in a Popup. Take a look at my project you will understand better. 

Note: Generate jpeg is important because I need to publish it automatically on facebook.

I think this project above have some tricks for me. But i'm very newbie on node for read and understand this.


@Mark
Thx. It's a nice idea. Maybe i can make a pdf and later convert this to a jpeg and send to facebook.

@q2
I will try this. Thx



2014-02-05 William Wicks <wjw...@gmail.com>:

--
Lincoln Lemos
62 81998667

Lincoln Lemos

unread,
Feb 10, 2014, 8:00:51 AM2/10/14
to nod...@googlegroups.com
Yes, I want click on 'print' button and this send a job to a user's printer. (With no dialogs).
Maybe i can make a function to click "Print Automatically", and send the jobs with no actions.




--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Lincoln Lemos
62 81998667

Zlatko Đurić

unread,
Feb 10, 2014, 9:14:32 AM2/10/14
to nod...@googlegroups.com
On 02/10/2014 02:00 PM, Lincoln Lemos wrote:
Yes, I want click on 'print' button and this send a job to a user's printer. (With no dialogs).
Maybe i can make a function to click "Print Automatically", and send the jobs with no actions.


Uh, then tough luck! I don't think this is possible with any server-side code, at least not in the regular sense.

I think the most that you can do here is autostart a print dialog. That means doing something like window.print(); or iframeElement.print(); in frontend javascript. But it's not related to node. Also, the above will not automatically print, it will just open the users' print dialog - if they have any installed.

The problem is generally in that that the browser scripts cannot access hardware, and probably the browser itself can't access it by default.

It could possibly be done with some sort of browser extension, but I'm not sure about this.

In any case, it is nothing to do with node.js. Your server will probably have no access to the printer ports if it is not in a sort of a vpn or local network and having remote admin access to the users' computer. Which is probably not the case :)


You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/mV2DZWFjn2c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


-- 
Zlatko
Reply all
Reply to author
Forward
0 new messages