PDA

View Full Version : Print alternate: jpg from file instead of webpage



Strangeplant
02-15-2009, 05:36 PM
If possible, I would like to be able to click on a link to print a image file instead of the webpage. (BTW, I'm using a image gallery that requires MooTools, and the ddsmoothmenu menu that uses jQuery, so using more js is......)

Reason: I need to add text (contained in the image) and center a larger, higher quality image. I can set the printer output using the reference on the dd page: http://www.dynamicdrive.com/dynamicindex9/printstyle.htm, but I have numerous, changeable images from the gallery viewer that I'm using, so I have to change this dynamically as the a link changes during slide show or as clicked:
<link rel=alternate media=print href="printversion.doc">And, of course, the jpg file cannot be printed without imbedding it in a html file. I certainly do not want to create each one of those html files, but I will if I have to - would be great to have a generic - but I don't see how at this moment.

What is the best way to do this?...or must I be happy with popping the image in a new window and let the user print that?

Has anyone else done this? Suggestions, Please?.......

jscheuer1
02-15-2009, 05:57 PM
If you have PHP, you could use just one page. Feed it the URL of the jpg image to display.

You could have javascript on that page to print it when the image is loaded.

Or, without PHP, you could have a section on your page, invisible and placed outside the page area via positioning. Your print stylesheet could make all but that section display none and bring it into the page area and reveal it. Have an image tag there, load the image into it and print the page.