We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › how to print the jpg/png file to printer
Page Index Toggle Pages: 1
how to print the jpg/png file to printer (Read 2056 times)
how to print the jpg/png file to printer
May 3rd, 2008, 10:31am
 
There is no existing function call for print out, is there any other library or code that I can use?

What I want to do is:

1) saveframe to a png file ( i can use existing saveFrame() command)
2) print out the png file to a default printer

thanks...
Re: how to print the jpg/png file to printer
Reply #1 - May 10th, 2008, 10:01am
 
Hihi, anyone can help on this matter?
Re: how to print the jpg/png file to printer
Reply #2 - May 10th, 2008, 11:18pm
 
From what I saw, people create a PDF file then print it.
Your solution might work too, if the PNG files are large enough.
You can output them then print the files in batch (eg. in Windows I would use IrfanView for that).
I never tried to print from Java yet.
Re: how to print the jpg/png file to printer
Reply #3 - Apr 22nd, 2009, 3:41pm
 
(For Windows Users)
you can do this easely with Irfanview (Freeware)

After download make a txt file and copy the line:
@"c:\program files\irfanview\i_view32.exe" %*
sava as "irfanview.bat" in your windows directory

Now you can create print.cmd file with irfanview line code:

irfanview c:test.jpg /print  
Open 'c:test.jpg', print the image to default printer and close IrfanView.  

irfanview c:test.jpg /print="Printer Name"  
Open 'c:test.jpg', print the image to specific printer and close IrfanView.  

irfanview c:*.jpg /print  
Print all JPGs from "C:" and close IrfanView.  

For other codes, like resize, etc check:http://www.downloadatoz.com/manual/ir/irfanview/hlp_command_line.htm

you can call this print.cmd file from processing with
open("c:/print.cmd");

you could also convert this cmd files to exe files. Don't know why, but I realised they are much more steable when you call them from pocessing.
Page Index Toggle Pages: 1