473,508 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to display a pdf file using code?

Hi,

I want to use a button to display a pdf file. I have Windows 2000
server, IE 6 and Acrobat 7 with plug-in. I can use <a> link to display
it.

I search this group for js code but they don't work. I tried this
code:

<form><input type="button" value="View PDF" onclick="window.location =
'c:\Barcode1234.pdf';">
<input type="button" value="View"
onclick="window.open('c:\Barcode1234.pdf')">
</form>

The first button displays "The page cannot be displayed...".
The 2nd button displays new window displaying the drives on the PC,
such as A:, C: and D:.

Why does <a> works but not the code? Could you try the code and fix
it? May be I need to provide the file type but do not know the syntax.
Thanks a lot

Jenny

Jul 23 '05 #1
3 19557


Jenny wrote:

I want to use a button to display a pdf file.
Why can't you use a normal HTML link (and style that with CSS as a
button if needed)?
I search this group for js code but they don't work. I tried this
code:

<input type="button" value="View PDF" onclick="window.location =
'c:\Barcode1234.pdf';">
Use a proper file URL e.g.
<input type="button"
onclick="window.location = 'file:///C:/Barcode1234.pdf';"
...>
<input type="button" value="View"
onclick="window.open('c:\Barcode1234.pdf')">


Same here
onclick="window.open('file:///C:/Barcode1234.pdf');"

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
On 7 Jan 2005 11:33:51 -0800 Jenny wrote:
Hi, I want to use a button to display a pdf file. I have Windows 2000
server, IE 6 and Acrobat 7 with plug-in. I can use <a> link to display
it. I search this group for js code but they don't work. I tried this
code:


I'm no expert with the coding, but I do not believe what you want to do is
possible.
As the "Adobe reader" has to be installed on the client's machine to work.
It may be possible though, to have it open up from the server, in which case
you'd need the reader installed on the server.
For that, I would suggest you contact your host for assistance.
Jul 23 '05 #3

Jenny <je************@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I want to use a button to display a pdf file. I have Windows 2000
server, IE 6 and Acrobat 7 with plug-in. I can use <a> link to display
it.

I search this group for js code but they don't work. I tried this
code:

<form><input type="button" value="View PDF" onclick="window.location =
'c:\Barcode1234.pdf';">
<input type="button" value="View"
onclick="window.open('c:\Barcode1234.pdf')">
</form>


A single backslash is interpreted as the start of an escape sequence.
Use a forward slash: 'c:/Barcode1234.pdf'
or escape the backslash: 'c:\\Barcode1234.pdf'
--
S.C.
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
3124
by: Mat | last post by:
<div id="container"> <div id="main"> <div id="header"> <p class="Address">123 Fake Street, </p> <p class="City">Crazy City, </p> <p class="Province">Ontario </p> <p class="PostalCode">H0H...
9
1966
by: Wally | last post by:
I am trying to display images from an Access 2000 database and I get an error "Invalid Parameter Used" when I execute the code line "picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual...
5
15803
by: David Elliott | last post by:
I need a control on a Web Page that can accept an HTML Document and will display it. Any help would be appreciated. Thanks, Dave Here is what I was trying...
18
3185
by: Terry Holland | last post by:
I have an asp.net (1.1) application that connects to a SQL server 2000 db. I have a stored procedure in my db that out puts data in xml format. What I need to be able to do is display that xml...
6
1895
by: Aspiring .NET Programmer | last post by:
Happy Friday everyone!!! I am working on a windows service and a C# application and needed some help with certain functionality. Please read through my issue below. Thanks! I have a windows...
8
2197
by: nickyeng | last post by:
I have written 3 files, i dont know whether i do it correctly or wrongly but somehow it compiled well and can run. My simple aim is to display the terrain.txt file into the terrain array, and then...
9
2059
by: tomhawkins1 | last post by:
Hi I currently have a site where users can upload files. These files can be doc, wmv, jpeg, xls, dwf, dwf and dwg. These files are uploaded to /home/**user**/uploads and not /home/...
3
2832
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I have a asp.net app, in the page there is a scan activex which could scan and save a jpg file in client harddisk. How could we access and display this jpg file on the fly using js in the client...
9
4091
by: tshad | last post by:
I have a Windows App that is doing some work and then writing a "Now Processing..." line to the status line of the window as well as the Textbox on the form. But the problem is that the work is...
4
5893
by: altaafhussein | last post by:
Hi, the question explains my problem. How do you display a .mov video/audio file in a .net application using vb.net. I have figured out how to display the video in asp.net with the following code...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7133
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
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7066
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
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1568
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 ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.