Wierd one - printing images on SERVER printer from PHP

Discussion in 'Programming' started by deathshadow, Jan 24, 2008.

  1. #1
    Yes, you read that right. I'm developing a business WAN application that the end user is going to be uploading images in a special format that I JUST finished writing a program to convert into .png or .jpg. (GUH, that sucked) so it can be displayed in their browser.

    The thing is they have a special vinyl etching device that I also JUST got working attached to this centralized server (it works just like a normal printer, just the medium is different) that I want the users to be able to print to, so that the printed copies (did I mention special process) can be drop-mailed (at the same time the shipping label is going to be printed on another printer).

    I've never really dealt with server side printing of images before - normally I'd just shell LPR (which is working for the labels since those are plaintext) but with a .jpg or .png that's not really viable (or just isn't working) - I'm able to print the images from the GIMP to this printer fine.. So, does anybody know how to from PHP print an image file to a printer attached to the SERVER?

    I know, this one's a bit above and beyond the norm.
     
    deathshadow, Jan 24, 2008 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Does it have to PHP? It is fairly simple to achive with .Net and its System.Drawing.Printing class so an ASP.Net page would be 10 lines of code or so (excl error handling)
     
    AstarothSolutions, Jan 25, 2008 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #3
    *nix deployable - .net is NOT an option. (nor should it be - I'm talking about a SERVER, not a tinkertoy)
     
    deathshadow, Jan 25, 2008 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    :) Would certainly argue that linux is as much a tinkertoy server as windoz

    That said, .net can still run under *nix with Mono
     
    AstarothSolutions, Jan 25, 2008 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Kind of - a lot of hardware integration still doesn't work - in general that's more headache than I need.

    I ended up writing a custom program in free pascal that calls GTK to render and print. Not a perfect solution, but it works. If the GIMP can load and print an image, no reason the toolkit based on it can't do the same.

    Then I just call the program using shell_exec. Same solution, different language ;)
     
    deathshadow, Jan 25, 2008 IP
  6. sharqi

    sharqi Guest

    Messages:
    105
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Pascal - show me the love baby! <3
     
    sharqi, Jan 25, 2008 IP