You can't.
More detail. You wouldn't use the copy function ("I want to use the basename function to resize an image. How do I do that?")
On a windows machine you could use PHP's [man]printer[/man] functions (on which page there is also a small comment about doing the same thing under Un*x).
If you know the name of the port your printer is connected to (lpt1, or whatever) I understand you can open it for writing and write to it. No doubt you can do likewise with the printer device under Un*x, since there everything is a file anyway.