webOS Nation Forums >  Homebrew >  TouchPad Patches > Printing to any printer using the Touchpad (solution!)
Printing to any printer using the Touchpad (solution!)
  Reply
Like Tree87Likes

 
Thread Tools Display Modes
Old 09/14/2011, 08:57 PM   #1 (permalink)
Member
 
theomodsim's Avatar
 
Posts: 90
Update 10/26/2011:
Version 1.2.1 has been released. This release contains a fix that forces GhostScript to print simplex or duplex (based on the job setting). This should hopefully resolve issues that users reported about jobs not printing single-sided or double-sided (based on the selected option on the TouchPad).

Summary:
Touch2Pc Printer is a Windows application that emulates an HP printer and accepts print jobs from the TouchPad. From there, the received job is converted to PDF and optionally printed to a physical printer added to Windows.

Where can I download?
Binaries are available at: http://dl.dropbox.com/u/24894676/Tou...ter_v1.2.1.zip
Source code is available at: http://dl.dropbox.com/u/24894676/Tou...v1.2.1_src.zip

How do I run it?
  1. Verify that .NET Framework 4 is installed on your machine (you can check by opening Add/Remove Programs and look for "Microsoft .NET Framework 4" or something similar). If it's not installed, you can download it at Download Details - Microsoft Download Center - Microsoft .NET Framework 4 (Standalone Installer)
  2. Open TouchPad2PcPrinter.exe and configure the options as follows:
    1. If you want to print to a physical printer, select the printer from one of the drop down boxes that corresponds to the capabilities of that printer (if you have a Simplex printer that prints Color, select that printer for the “Simplex/Color” drop-down). When you print from the TouchPad and specify 1-sided color printing, the print job will be printed on the “Simplex/Color” printer that you selected. You can support up to four different printing “profiles” by selecting different printers to handle jobs that require different capabilities.
    2. If you are only “printing to PDF”, check the check box labeled “Print to PDF only”. This will disable the drop down boxes for the output printer. All PDF files are still in color (there’s no way to force black and white PDFs) .It might be convenient to set your Output Folder to your DropBox folder, so you can immediately view the PDF from the TouchPad.
  3. Click “Save”.
  4. Click “Start”. This will start the Touch2Pc Printer server.
  5. If a firewall warning dialog appears, be sure to allow Touch2Pc Printer network access (allow the firewall exception).
  6. On the TouchPad, open the Printer Settings application.
  7. Tap on “Add or remove printer”.
  8. Type in the IP address of your computer. If you’re not sure of your IP address, open a command prompt and type “ipconfig” and then press ENTER.
  9. You can name the printer whatever you want.
  10. You should now be able to send print jobs from the TouchPad to your computer!

Which ports need to be open?
Touch2Pc Printer requires that TCP port 9100 and UDP port 161 be open for the program to work correctly. Also, the computer that the program is running on must be pingable from the TouchPad.

How does it work?
The program does multiple things, one of which is respond to SNMP requests sent by the TouchPad to identify the "printer". Whenever the TouchPad sends SNMP requests, the program responds with information about the HP pseudo-printer. Namely, SNMP variable 1.3.6.1.4.1.11.2.3.9.1.1.7.0 is used to retrieve the device string. This is how the TouchPad determines if a printer is an HP or not (see line 27 and 29 of SnmpObjects.cs to see what exactly the program sends as the response for that variable request).

Once the TouchPad has received the SNMP response, it then presents the user with the print dialog. After the user confirms the print job, the TouchPad sends the print job (as a PCL file) to TCP/IP port 9100, which the program is listening on. The program reads in the job.

After the program has received the job, the job is then converted to either PostScript (for physical printer printing), or PDF (for "printing to PDF") using GhostPCL. If printing to a physical printer, the program calls into the GhostScript API to print the PostScript file.

Disadvantages
I think the primary disadvantage to this solution is that you need to have a computer on the same local network running this program whenever you want to print. If you primarily use the TouchPad wherever you have a computer, that shouldn't pose a big problem.

License
Touch2Pc Printer is licensed under the GPL v3. However, it uses some components that are licensed under different terms (see legal.txt for details).

Special Thanks
Thanks to McTristan for working on several stability and new feature updates.

I'd be happy to help anyone out if they encounter issues with the program.

Previous Versions
Version 1.2.0 binaries: http://dl.dropbox.com/u/24894676/Tou...ter_v1.2.0.zip
Version 1.2.0 source: http://dl.dropbox.com/u/24894676/Tou...v1.2.0_src.zip

Version 1.1.3 binaries: http://dl.dropbox.com/u/24894676/Tou...ter_v1.1.3.zip
Version 1.1.3 source: http://dl.dropbox.com/u/24894676/Tou...v1.1.3_src.zip

Version 1.1.2 binaries: http://dl.dropbox.com/u/24894676/Tou...ter_v1.1.2.zip
Version 1.1.2 source: http://dl.dropbox.com/u/24894676/Tou...v1.1.2_src.zip

Version 1.1.0 binaries: http://dl.dropbox.com/u/24894676/Tou...inter_v1.1.zip
Version 1.1.0 source: http://dl.dropbox.com/u/24894676/Tou...r_v1.1_src.zip

Version 1.0.0 binaries: http://dl.dropbox.com/u/24894676/tou...daemon_bin.zip
Version 1.0.0 source: http://dl.dropbox.com/u/24894676/tou...mon_source.zip

Last edited by theomodsim; 11/05/2011 at 01:20 PM. Reason: Previous version list
theomodsim is offline   Reply With Quote
Liked by spud101, Sukiyaki, cobra and 54 others like this.
Old 09/14/2011, 09:14 PM   #2 (permalink)
Member
 
Posts: 303
Awesome job!!!
rstark is offline   Reply With Quote
Liked by Maverick_[GER] likes this.
Old 09/14/2011, 09:31 PM   #3 (permalink)
Member
 
Posts: 133
Great work. I'm sure this will come in handy for those of you who do not own HP printers. I myself decided to take the plunge and picked up an acceptable HP D110a and never looked back.
zefyx is offline   Reply With Quote
Thanked By: slotalkinwoman
Old 09/14/2011, 10:23 PM   #4 (permalink)
Member
 
Posts: 345
This really is awesome... thanks so much for sharing it with the rest of us. I just printed my first doc from the Touchpad to a Canon printer. Woohoo! I did encounter a problem though.

The program attempts to write to an "output" subdirectory underneath it's installation folder. If that folder is within a Program Files subdirectory though it'll fail on Windows 7 - programs can no longer write to the Program Files directory or sub-directories. Simple to work-around by just installing it elsewhere but it would be better if the program wrote it's output to the %TEMP% folder or perhaps %APPDATA%, then it would work regardless.

Thanks again though... this is gonna end up on the front page of PreCentral soon I'm sure.
ALuckyGuy is offline   Reply With Quote
Old 09/14/2011, 10:26 PM   #5 (permalink)
Member
 
Posts: 345
Also, the program did leave an empty Adobe Acrobat window open after the printing finished. It'd be nice if that could be cleaned up on exit too, or at least opened in a hidden window.
ALuckyGuy is offline   Reply With Quote
Old 09/14/2011, 10:45 PM   #6 (permalink)
Member
 
timjhenry's Avatar
 
Posts: 107
This is pretty cool. Thanks for posting this! I know what I'm messing around with this weekend now!
timjhenry is offline   Reply With Quote
Old 09/14/2011, 10:48 PM   #7 (permalink)
Member
 
Posts: 52
I might be missing something. I ran the command lines, approved the firewall access, added the printer successfully to my touchpad. However, whenever I try to print the command keeps saying EXCEPTION OCCURRED: the system cannot find the file specified.
This is on WIN 7 home premium 64 bit.

also does the command have to be up at all times, or is there another way of running the program? Thanks.
jxrxblanchard is offline   Reply With Quote
Old 09/14/2011, 11:07 PM   #8 (permalink)
Member
 
Posts: 94
Will this work with a wireless printer?
dentz is offline   Reply With Quote
Old 09/14/2011, 11:11 PM   #9 (permalink)
Member
 
kkhanmd's Avatar
 
Posts: 2,069
i hope one day this would become a patch
__________________
If this helped you hit thanks.
kkhanmd is offline   Reply With Quote
Old 09/15/2011, 05:46 AM   #10 (permalink)
Member
 
Posts: 6
Quote:
Originally Posted by dentz View Post
Will this work with a wireless printer?
What else will it work for?
robot1000 is offline   Reply With Quote
Old 09/15/2011, 07:49 AM   #11 (permalink)
Member
 
Posts: 1
Great work!
Would be even better if someone can make a Linux version of this programm running as a deamon on my Ubuntu media server pc at home!
rumrix is offline   Reply With Quote
Old 09/15/2011, 07:55 AM   #12 (permalink)
Member
 
Posts: 345
Quote:
Originally Posted by kkhanmd View Post
i hope one day this would become a patch
This will never be a patch because it doesn't change anything on the Touchpad. The program is installed on a PC. It cleverly masquerades as an HP printer to accept your print request and send it to your default printer.
ALuckyGuy is offline   Reply With Quote
Old 09/15/2011, 08:00 AM   #13 (permalink)
Member
 
Posts: 36
Excellent work

Any chance of img of your command promt input screen as I'm getting lost with dos commands it would just help see what it should look like.

Cheers
funb0b is offline   Reply With Quote
Old 09/15/2011, 08:19 AM   #14 (permalink)
Member
 
Posts: 86
Will this work on a Mac?
wilburjoe is offline   Reply With Quote
Old 09/15/2011, 08:50 AM   #15 (permalink)
Member
 
Posts: 57
Maybe I'm completely off with this thought, but wouldn't it be (theoretically) possible to implement the same functionality ON the Touchpad itself? So the program would run on the TP and pretend to be a HP printer, while it actually receives the file and forwards it to a non-HP printer?
Alphajoe is offline   Reply With Quote
Old 09/15/2011, 09:09 AM   #16 (permalink)
Member
 
johncc's Avatar
 
Posts: 4,191
Quote:
Originally Posted by Alphajoe View Post
Maybe I'm completely off with this thought, but wouldn't it be (theoretically) possible to implement the same functionality ON the Touchpad itself? So the program would run on the TP and pretend to be a HP printer, while it actually receives the file and forwards it to a non-HP printer?
Not really. Because what it is doing is effectively providing an internet connected HP printer emulating driver for your computer's default printer.

Thanks theomodsim. Apart from leaving Acrobat reader open it worked great on my XP machine (once I had installed .NET and MS WIC)
johncc is offline   Reply With Quote
Thanked By: achimi
Old 09/15/2011, 10:31 AM   #17 (permalink)
Moderator
 
OldSkoolVWLover's Avatar
 
Posts: 7,732
Quote:
Originally Posted by dentz View Post
Will this work with a wireless printer?
Same question.

Also how are people doing this, networked printer, usb connected, wireless?

Since it sends to the computers default printer, I am guessing this will work with any of the 3, it just has to be the PC's default printer.


Great work to the OP BTW... too bad my printer is direct wired to my office computer that is only on when I need to use it.
__________________
I love physical keyboards... but there is two devices that would make me consider a slab, one is something running a full version of Open webOS. The other is an iPhone!!!! HA HA just kidding (about the iPhone that is)...
OldSkoolVWLover is offline   Reply With Quote
Liked by Mario Luna likes this.
Old 09/15/2011, 11:00 AM   #18 (permalink)
Member
 
Posts: 345
Quote:
Originally Posted by Alphajoe View Post
Maybe I'm completely off with this thought, but wouldn't it be (theoretically) possible to implement the same functionality ON the Touchpad itself? So the program would run on the TP and pretend to be a HP printer, while it actually receives the file and forwards it to a non-HP printer?
At this point patching the Touchpad to print to non-HP printers is *truly* only theoretically possible. It's not practical and likely won't be done because the source code isn't available. Unlike a lot of the apps provided with WebOS, the printing functionality isn't implemented in javascript or another language with source code that's available. Virtually all of the patches available are possible because Palm/HP has provided source and thus it can be interrogated and changed.
ALuckyGuy is offline   Reply With Quote
Thanked By: sketch42
Old 09/15/2011, 11:07 AM   #19 (permalink)
Member
 
Posts: 168
Great! Thanks for this!

One question, though.... any chance you could support Foxit reader for printing? Adobe is such a resource hogging sack of crap that I don't want to switch unless I have to...

Last edited by Xeron; 09/15/2011 at 11:31 AM.
Xeron is offline   Reply With Quote
Old 09/15/2011, 11:17 AM   #20 (permalink)
Member
 
Posts: 57
Thanks for the info. I was afraid of such an answer...
Alphajoe is offline   Reply With Quote
Liked by kushina likes this.
Reply

 

Tags
printing, touchpad

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0