Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    printing images by code

    so then how can i print images using javscript code or other code..

  2. #2
    Regular Coder
    Join Date
    Jul 2002
    Location
    Iran
    Posts
    695
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The only way that comes to my mind is to open it in a new blank window and then use window.print() to print it. I never saw a special function/way for printing an image in JS.

  3. #3
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    There is a way.

    This will not work in NS4 as far as I know...

    <link rel="alternate" media="print" href="printthis.txt" />

    You want to print images. I think you could just change the href to something like, myimage.gif.

    If that doesn't work, do what ConfusedOfLife suggested.

  4. #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    Iran
    Posts
    695
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you make that link dynamically too? I mean if I have a button on the page and then I click on it, it starts printing it not when the document is loading?

  5. #5
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Im sure I saw something on dynamic drive once, about choosing a document to print.

    If I find it I will post back.

  6. #6
    Banned
    Join Date
    Mar 2003
    Posts
    224
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you mean this? or,this?





    beat you
    Last edited by mattover-matter; 04-05-2003 at 04:16 PM.

  7. #7
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    yeh matt the second one is good. I found it a couple of days ago when looking for another script which I still cant find.

    The only down side is that I have to add it to stacks of pages - o and make the printversion.doc as well . Just when I thought I had finished.

  8. #8
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    neither.

    Im sure there was another one. maybe it wasnt on DD.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •