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 & HelpSyntax Questions › Save image and send to printer
Page Index Toggle Pages: 1
Save image and send to printer (Read 793 times)
Save image and send to printer
Feb 14th, 2009, 9:25pm
 
Hi,

This is a really basic question as I am a beginner.

I have created an applet and I would really love to able enable the user to save the image and print it out (or just print out) as the applet is running. I realise that there is a save image function in processing, but is there a print out function? If so, what would be the code to save and print out and where should I place this within the applet?

I have searched for this and haven't been able to find it.

Thankyou and my apologies for the basic nature of the question.
Re: Save image and send to printer
Reply #1 - Feb 14th, 2009, 11:18pm
 
I don't really know if an applet can print. Even for just saving an image, the applet must be signed.
Anyway, if the user can save the image, they can print it out with their usual tools, I think.
Re: Save image and send to printer
Reply #2 - Feb 14th, 2009, 11:50pm
 
Hi,

Thankyou for the reply. I will look into just saving out and printing using manual methods.

Thanks again.
Re: Save image and send to printer
Reply #3 - Feb 15th, 2009, 6:32am
 
Automatic printing without accepting is not possible i guess. but you can hack together a php java processing combination checking a special folder and calling the print command if there are any new images...
should work somehow.

check out this post that offers some solutions
http://www.rohitab.com/discuss/lofiversion/index.php/t27856.html

Re: Save image and send to printer
Reply #4 - Feb 15th, 2009, 10:00am
 
Cedric, if the server prints, it isn't very useful, unless the service sends by snail mail the result...

Now, that's indeed an alternative with the advantage of not needing signature: upload the image to server as I show in Re: save to web --- image export, then redirect to a page showing the image: the user can then save the image or print it, using the usual browser facilities.
Re: Save image and send to printer
Reply #5 - Feb 15th, 2009, 10:38am
 
What the script should actually do is what you said, just redirecting you to a page showing the image or loading it in a hidden div or something, and calls the printing script... anyway, its not much better then asking you to save or print it by yourself...


<html>
<head>
<title>Printing ...</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script LANGUAGE="JavaScript">
<!-- Begin
function myprint() {
print();
}
// End -->
</SCRIPT>
</head>

<BODY onLoad="myprint()">
<p>Youve auto printed this page using, the Print() in JavaScript, congrats</p>
<p>blah blah blah blah</p>
<p>blah blah blah blah</p>
</body>
</html>


Anyway, im pretty sure you are right Smiley
Re: Save image and send to printer
Reply #6 - Feb 16th, 2009, 9:46am
 
Hi,

Thankyou Cedric and Philho. I will check out these options, but like you said it would result in the same number of actions as printing out manually.

Thanks for the help though.
Page Index Toggle Pages: 1