#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Boston, MA USA
    Posts
    386
    Rep Power
    47

    Printing Labels from PHP


    Hi:

    I am trying to print name badges from a MySQL database on a DYMO LabelWriter printer (form size: 2-7/16 x 4-3/16 in.) using a PHP report... Can this be done? I'm struggling with where to even begin...

    Any thoughts?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,470
    Rep Power
    594
    Yes. See if this will get you started.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6351
    If you're printing this on a printer connected to the SERVER you'll need what gw provided (I think).

    If you're printing this on a printer connected to the CLIENT you just need to find the manual for the printer and see what the dimensions are for files/images to be printed to the printer so they show up properly.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,470
    Rep Power
    594
    Just to clarify, if you are using PHP then obviously you are planning to this on the server. However, if from the client (that is why I was not as forward thinking as ManiacDan) then you would not use PHP at all. Instead you would probably use Javascript.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  8. #5
  9. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6351
    I've made PHP websites for use internally within a company which printed barcodes and other information on zebra printers, and we ended up expanding that site to customers who would buy zebra printers to do the same thing. PHP generated the barcodes and all the data and whatnot, and the only thing JS was for was invoking the print dialog.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,470
    Rep Power
    594
    I don't want to hijack this thread but did you use Ajax to send the print data back or present a print page for the client to invoke?
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  12. #7
  13. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6351
    It was 10 years ago, so I may be incorrect, but I believe we base64_encode'd the image and stored it in a JS variable, which generated a popup with a print CSS and auto-invoked the print dialog.

    I think.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Boston, MA USA
    Posts
    386
    Rep Power
    47
    Thanks, everyone for all of your responses. You've certainly given me some great places to start.

IMN logo majestic logo threadwatch logo seochat tools logo