I recently got a new printer (specifically a HP Photosmart C6380 if that helps) that allows me to send text to port 9100 to print. Telnetting into it and typing text to print works fine, but I'm wondering if I could make a webpage using HTML and Javascript that can send text directly to it.
I'm currently using the code from the article Cross Site Printing (pdf), but the downside is that when it prints out it shows the entire POST request and not just the text.
So my question for you is am I able to send just the content of the POST request or strip the unneeded characters using only HTML and Javascript?
Note: The reason why it's limited to HTML and Javascript is because I'm hoping that I can use this on an iPhone or iPod Touch.
Edit: It appears that there's no way to get rid of the HTTP headers, so now my question is can I craft a custom POST request that will minimize on what is sent in the header? For example, can I not send the user agent since the printer doesn't care what the user agent is?