#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    3
    Rep Power
    0

    cold fusion printing


    I need a script, function, anything that will do the following:

    upon a button being pushed it makes a server call generating some data to be printed. It will then generate a form (hidden and completely unseen by the user), prints it and returns to its normal state. The real problem is I need it to print client-side rather than server-side. Any ideas would be much appreciated!!!
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Hi Jediwheatie,

    unfortuantly I dont think its possible with CF. Because CF is a server side utility it can't really get access to a clients printer, if you could that would be a really bad idea. Think about all the ad's you would get punted through.. You can do it with Javascript, the printer box will apear asking the user if they want to print or not.

    It's a very long shot but maybe you could open a socket to the client's machine and send the data directly to the printer, but then i wouldn't know where to start. You'd also have to worry about things like OS and etc.

    I'd stick to javascript and use the print function for this.

    Hope this helps,
    Mark.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    3
    Rep Power
    0
    Unfortunately however, javascript doesn't have the functions that I am requiring, unless of course, I don't know as much Javascript is as required. I need to click a button, make a coldfusion server call, return to the same page, and while that is happening, some script or anything to print something to a printer(never seen on screen). Anytime you generate a window and try to close it, it will then ask "The browser you are currently using is trying to be closed, Is this ok?" which I cannot have as a security risk. Let me know if you know any javascript functions to allow this type of functionality.
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    you don't need to know much Javascript. maybe i didnt explane very well. use CF to generate your new page with a print function set to print OnLoad, the page will then be printed when it's done loading (with the users ok).

    The rest I have no dout you can and should be do with CF, all I was trying to say what that CF cant access the printer, you need Javascript to do this for you.

    Take care,
    Mark.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    3
    Rep Power
    0
    thanks.
  10. #6
  11. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Very welcome Jedi, if you need any help i'd be happy to. I dont know much CF though .

    Mark.

IMN logo majestic logo threadwatch logo seochat tools logo