473,472 Members | 2,153 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need help with changing javascript for download pdf

3 New Member
This is the current script for a print this page function:
<span class='print'><a href='javascript:window.print()' class='first'>PRINT THIS PAGE</a></span>\

I want to be able to change it to "DOWNLOAD PDF".

I have created all my pdfs of each page (instead of print page, I saved each page as a pdf)

I want to be able to download each individual page on a site but do not know how to change the main .js file to do that. Can someone advise?
Nov 27 '07 #1
5 1435
JosAH
11,448 Recognized Expert MVP
You do realize that this is a Java Forum, not a Javascript Forum do you? Also
realize that Java (or JSPs) are evaluated/executed on the server side while
Javascript is executed in your browser on the client side.

Do you want me to move your question over to the Javascript Forum?

kind regards,

Jos
Nov 27 '07 #2
mochabean
3 New Member
My apologies! I am new at this. If you can move this, that would be very great! thank you.



You do realize that this is a Java Forum, not a Javascript Forum do you? Also
realize that Java (or JSPs) are evaluated/executed on the server side while
Javascript is executed in your browser on the client side.

Do you want me to move your question over to the Javascript Forum?

kind regards,

Jos
Nov 27 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
This is the current script for a print this page function:
<span class='print'><a href='javascript:window.print()' class='first'>PRINT THIS PAGE</a></span>\

I want to be able to change it to "DOWNLOAD PDF".

I have created all my pdfs of each page (instead of print page, I saved each page as a pdf)

I want to be able to download each individual page on a site but do not know how to change the main .js file to do that. Can someone advise?
Change the hrefs to point to the PDFs.

As for the text, you could just modify it yourself unless you need to do it dynamically.

Can you post your code?
Nov 27 '07 #4
mochabean
3 New Member
Hi. this is the code:

Expand|Select|Wrap|Line Numbers
  1. $(function(){
  2.  
  3.     // print return contact copy
  4.     // FOOTER 
  5.     footer = "<div class='footer'>\
  6.     <span class='print'><a href='javascript:window.print()' class='first'>PRINT PAGE</a></span>\
  7.     <span class='top'>|<a href='#'>RETURN TO TOP</a></span>\
  8.     <span class='contact'>|<a href='contact.htm'>CONTACT</a></span>\
  9.     <span class='copy' >|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &copy; 2007 CO NAME.</span>\
  10.     </div>"
  11.  
  12.     $("#content").append( footer )
  13.     $(".team .top").hide()
  14.  
  15.     //$('#content').jScrollPane(  {showArrows :true, scrollbarWidth:15} );
  16.  
  17.     //MIN-HEIGHT
  18.     wh = $(window).height()
  19.     dh = $(document).height()
  20.     if ( dh <= wh ){$(".container").css("height", wh-25 + "px")/* 25 px from conntainer padding top */ }
  21.  
  22.     //left column filler
  23.     $("td.left_col").append( '<div class="filler">&nbsp;</div>' )
  24.     o=$(".filler").offset()
  25.     new_filler_height = dh - o.top
  26.     $(".filler").height( new_filler_height )
  27.     //alert("wh = "+wh+", dh = "+dh+", filler.offset = "+o.top+", calc = "+ new_filler_height )
  28.  
  29. })
Nov 27 '07 #5
acoder
16,027 Recognized Expert Moderator MVP
Is it not as simple as:
[HTML]<span class='print'><a href='the_pdf_file.pdf' class='first'>DOWNLOAD PDF</a></span>[/HTML]
Nov 28 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: bin_P19 P | last post by:
the code i have got is as follows and now im stuck <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Shopping...
5
by: Rami A. Kishek | last post by:
I'm new to js. Please help me figure this out WANT: Client to save an image to disk pressing a "download" button. The image name is dynamic, from JS code on another part of the page DID: Read...
35
by: Boobie | last post by:
I need to escape HTML chracters so <test> --> &lt;test&gt; Looks like there is no built-in JS function...anyone got one handy ? thanks
1
by: Jeff Cooper | last post by:
Hey there folks, I have a link on a page which I would like to point to string that's downloaded as a file -- a *.tab file to be exact. The link points to a file (download.aspx) which contains...
3
by: moondaddy | last post by:
I have some text in a page that when a certain even happens, I need to make it glow from black to red (through a spand of 1 second) pause for a few seconds, and then slowly change from red to black...
2
by: abarberis | last post by:
I am writing an asp.net application which is using image buttons for the interface. I have some buttons that have a enabled and disabled state. I have written javascript code to change the image on...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
7
by: MZ | last post by:
Hello, I have a webcam connected to the Internet. I can access the current static picture of the camera using an url link. It shows the picture with high resolution 1600x1200. I would like to...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.