Base64 Encoding

Here is something I put together from info on the web. The first line activates the cups web interface and the second will open that interface on your browser. You will be presented with a list of network printers and you can select the one you want and it will open another window with the information you need as to the address.

shellscript {cupsctl WebInterface=yes}
openurl "http://127.0.0.1:631/printers"

Don’t know if this will get you to where you need to be but it is all I could find. Here is the info returned for my wifi connected printer:

I am pretty sure that if you try to do anything with a printer through the CUPS interface, you will fail, and you may not be able to print anything. What you should do is set up the printer the way that you want it, and save the presets. I would suggest that if you really need special presets for this form, you might want to intercept the Print command to tell whoever is printing that it is necessary to make sure that the proper preset is chosen.

I have not tried this yet, but I think it might work if I use urltask(? I will know the ip address. I know the way the file needs to be constructed and encoded, I have the dev documents from epson but they do not describe, as far as I can tell, how to actually connect to the printers port. I think they leave that part up to the operating system.

Is that where you got the idea that base64 encoding is required? That makes no sense to me. Such a printer would be useless in 99.999% of uses. If true, then specialized software would be necessary, software that I would think would require specialist skills to write. I’m an experienced programmer, and I would think that it would take me at least months to acquire these skills. To me this sounds like selling a car without a transmission and expecting the driver to construct their own.

Here is the info from epson. “If you are using network interface printer, the developer should know how to send a text file (or text string) to printer IP address port 9100”

And, “If the extension is PNG, it is encoded in B64 format and transmitted to the host”

Maybe only the png is encoded? I do know that the commands for the printer are in acii.

In Panorama, how would I send the text string? postur(), urltask() ect?

macOS does not support directly communicating with a printer. Honestly, I doubt if Windows does either. I’m not saying it’s impossible, but it would be a hack, and a hack that I have no idea how to accomplish.

Thank you Jim, Ill let you know what I find out from epson dev support.

I was successful using shell script with lp and I found out that for direct communication with the printer it is using udp to port 9100. My next test is using panorama to construct the base64 encoded file with both image data, printer settings and variable data. I will update when I succeed. :slight_smile:

A quick question. How does the info(“printers”) function get its results? shell script?

No. It directly calls the Apple printing API.

Note: Panorama 6 used shell scripts quite a bit, because the Carbon API Panorama 6 was written in did not have direct access to a lot of system functionality. Panorama X hardly uses shell scripts at all, instead it directly accesses the necessary functions.