Solved

How to show a image link invisible to printer

Posted on 1997-07-16
14
180 Views
Last Modified: 2008-03-03
I need to include an imaga link in some pages that lend me to print the page. When this page print, I don`t want to include the image link. I need, then, to show a image that the navigator don´t print.
0
Comment
Question by:jjjj060497
  • 6
  • 5
  • 2
  • +1
14 Comments
 
LVL 5

Expert Comment

by:Trevor013097
ID: 1268542
Unfortunately there is no way to invoke the Print function either through HTML or through JavaScript and also there is no way of preventing images from printing but being able to display them.

Sorry to dissapoint you but there are still some things that HTML and Javascript just cannot do.

cheers,

    Trevor
0
 

Author Comment

by:jjjj060497
ID: 1268543
I can invoke a print function from a html page but i only want to find a image (or a text if there aren`t another posibility) that not print.
 I know that a button don´t be printed, but I prefer not to use it. I try to find the ssame function with a image link.

0
 
LVL 5

Expert Comment

by:Trevor013097
ID: 1268544
My appologies jjj I was not aware of a function to invoke print.

How do you do it?
0
 
LVL 3

Expert Comment

by:RM032397
ID: 1268545
Yes, I like Trevor would very much like to know the answer.

To make an image not print, put it so far to the right that it falls outside of the printed page area.
0
 

Author Comment

by:jjjj060497
ID: 1268546
This work is for a information kiosk. The user must view all the page without move all the time in the window. I must put the image in the printer area.
 The method I use to print need to install some programs in the client and configure the navigator he use.
 I have a mime type that open a program call "CONTROLP.exe". In the pages I want to print, I include a link to a file with this extension. The navigator launch the program and the program (CONTROLP) send some keys to the navigator. The navigator, finally , print.
 
0
 
LVL 1

Expert Comment

by:fun
ID: 1268547
In that case why don't you flip the image in question to a pixel gif just before you print. I assume you are using a browser like
Netscape that recognizes the image array. Then afterwards you can  reload the page or in some way reflip the image back to it's normal state.
0
 

Author Comment

by:jjjj060497
ID: 1268548
I don´t understand your answer. Please can you explain it more?. I don´t want to reload the page (it´s a dinamyc page).
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 1

Expert Comment

by:fun
ID: 1268549
I meant to use the image array to change the image to one that doesn't show on the page.
image[4].src="pixel.gif";

put this statement in the function that calls your print routine, and then after the print reset the image back to the original view.
image[4].src="original.gif"
0
 

Author Comment

by:jjjj060497
ID: 1268550
I don´t want to reload the page. I need that the image be transparent (invisible) only to print.

0
 
LVL 1

Expert Comment

by:fun
ID: 1268551
You will not have to reload the page, just change the image to one that won't show when you print the page. I never said anything about reloading the page. After you have printed the page, you can just change the image back to the original form.
0
 

Author Comment

by:jjjj060497
ID: 1268552
Ok. The problem is that I print the page sendingt a Control-p to the browser and I don´t know how to include the Javascript when I do that. Do you understand?. I don´t use a Javascript code to print, I use a sending of keys from a program that is called byt a virtual web page (with an extension not registered). It is like I pulse th Keys Control-p and Enter (you can prove it in the browser). How to tell the javascript code to active it when the browser print?.

0
 
LVL 1

Accepted Solution

by:
fun earned 50 total points
ID: 1268553
No I don't understand. Somehow the user must activate or do something that causes the print command to execute. Somthing must happen in the browser that causes it to print out. It is possible that you can use on onLoad event handler or an onChange handler that recognizes when you are going to try and print. If you would explain in detail the exact sequence of events that the user goes through and what happens to cause the print event, I might be able to suggest a course of action.
When you respond, stop rejecting my answer until I give up trying or you accept my answer. Respond by comments.
0
 

Author Comment

by:jjjj060497
ID: 1268554
Ok. The user click on one link to a url like this "file://c:/.../pepe.jj". The browser have a mime entry that tell it to use a program called "pbrprint". The browser open it. This program send the keys Control-p and Enter to the Browser. The Borwser Print (without reload the page i think).
 All of it is the same as you press the keys in a browser.
0
 
LVL 1

Expert Comment

by:fun
ID: 1268555
OK. You can use javascript to process an onClick handler for the link you pressed to first change the image to a pixel gif, then to activate the link that does the printing, then return the image to its original form. None of which should require that you reload the page.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now