That would depend on the "pen" that you use.
You can not implement a way to control something with an understanding of what you are trying to control.
If you use an injet head I would just send it the byte it needs to write that line on the media.
If you use a pen on a solonoid I would just send it the bit to either turn it on or off.
If you used a laser you would have a whole other set of problems.