Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 22nd, 2007, 9:50 PM   #1
MiKuS
Programmer
 
Join Date: Jun 2007
Posts: 84
Rep Power: 1 MiKuS is on a distinguished road
Printing lightwindow content

for those who don't know what lightwindow is:
http://www.stickmanlabs.com/lightwindow/

Now, my aim is to load up an image, and have a print button somewhere on the lightwindow, so user can print out a single image.

My first thought was to have lightwindow load up an external html file with a link, which when clicked runs the following javascript:
javascript:window.print();

The problem with this is that it prints both the page in the background and the lightwindow.

Now I figured out how i can solve this:
consider index.html as the page running lightwindow
consider image1.html as the page linking the target image with a link, linking to itself.


on index.html, assign the class "lightwindow page-options" to the anchor and have the link pointing to image1.html as per:
<a href="coupon1.html" title="Image One" params="lightwindow_width=407,lightwindow_height=330" class="lightwindow page-options"><img src="image1.html"></a>

and then on image1.html consider the following code:

<body onload="javascript:window.print();">
<p><img src="image1.png"/></p>
<p><br><a href="image1.html" class="print">Print This Coupon</a></p>
</body>

The above solutions works, but i don't like the way it works - I feel there is an easier way I'm missing.

Does anybody know any other ways I could go about this?
MiKuS is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRINTing hbe02 C++ 2 Mar 30th, 2006 2:47 AM
Printing escape sequences using printf()? bivhitscar C 5 Nov 3rd, 2005 10:08 PM
Putting content on Apache Server Epoch_Apex Other Web Development Languages 26 Oct 26th, 2005 12:01 PM
Printing From Printer Firebirdracer14 Visual Basic 2 Aug 4th, 2005 10:06 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:33 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC