473,795 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open new window and display PDF document...

Hello,

I would like to be able to open a new IE window on the client side and
display a PDF document in the new window. Many tutorial sites that I have
checked suggest opening a new IE window using client-side JavaScript and the
window.open() function. I suspect this is not the desired way as I would
like to output a PDF report from a byte array to the HTTP output stream to
this new window.

Any ideas?

TIA...
Jun 27 '08 #1
2 8483
Generating byte array/stream on the web server and open new browser window
are two different things. No, you cannot open new browser window with server
side code. New browser winodw is open opened by user action explicitly
(clicking a button/link, which calls client javascript code
"widow.open('pa geaddress');". So, you can use your server side code to
attach similar client side javascript code to a button/link, in which you
can specify the page that is generating PDF stream.

"H. Rodriguez" <hr********@hot mail.comwrote in message
news:aa******** *************** *******@giganew s.com...
Hello,

I would like to be able to open a new IE window on the client side and
display a PDF document in the new window. Many tutorial sites that I have
checked suggest opening a new IE window using client-side JavaScript and
the window.open() function. I suspect this is not the desired way as I
would like to output a PDF report from a byte array to the HTTP output
stream to this new window.

Any ideas?

TIA...
Jun 27 '08 #2
You're on the right track, but you'll also need to use
Page.ClientScri pt.RegisterStar tupScript.

e.g. user clicks a "show document" button.
On server side, use ClientScript.Re gisterStartupSc ript to register the
javascript which you want to automatically run on the client.
Write the javascript so that it opens a new brower window (using window.open
etc) at the new page which you will use to display the PDF.

On the new PDF page, do something like this to display the PDF in the
Page_Load event :

byte[] data = ... fill with PDF data
Response.Clear( );
Response.Conten tType = "applicatio n/pdf";
Response.Binary Write(data);
Response.End();

"H. Rodriguez" <hr********@hot mail.comwrote in message
news:aa******** *************** *******@giganew s.com...
Hello,

I would like to be able to open a new IE window on the client side and
display a PDF document in the new window. Many tutorial sites that I have
checked suggest opening a new IE window using client-side JavaScript and
the window.open() function. I suspect this is not the desired way as I
would like to output a PDF report from a byte array to the HTTP output
stream to this new window.

Jun 27 '08 #3

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

Similar topics

1
3355
by: Matt | last post by:
My problem is when the user click the submit button, it will launch another new window for the request page. I want to confirm we cannot use JavaScript open window functions to open a request page? The following page2.asp won't output the value entered in page1.asp. However, if we do <form action="page2.asp" method="get" target="_blank">, then it will open a new window for the request page, instead of using the same window as page1.asp....
1
10114
by: Winfried Koenig | last post by:
Hi everyone, I have a main page: -------------------------------------------------- <html><head><title>Test</title> </head><body> <img id="img_a" name="img_a" src="image_1.png" alt=""><br>
3
1841
by: Hermit Crab | last post by:
I'm seeing some unexpected (at least to me) behavior in the 'window' and 'document' objects under Netscape 7.1 and Internet Explorer 6.0. When a property is added to the prototype for 'Object', it was my understanding that it should be visible to all objects. But it appears that it is NOT visible in the 'window' object of either IE or Netscape. It is visible in the 'document' property of Netscape, but not IE. It is visible in...
2
16018
by: dan | last post by:
This works in mozilla but I can't figure out why this won't work in IE. Say I have this html <html> header goes here header goes here
4
7596
by: Anna Quick | last post by:
I am quite new to javascript, and don't seem to find the problem with stupid internet explorer. The script works fine in safari and mozilla. I searched the groups, but evidently put in the wrong keywords, didn't find the solution. It seems to be as easy as it gets: open a new window with a new url. in IE (I am using IE in mac osx), the error message is: Microsoft JScript runtime error: Line: 9
3
24717
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The situation is: A main window opens child windows one at a time as the user requests, each with its own name. The user may click in any child window or the main window to open a summary window, which has a name all windows know. I want to get that...
29
5033
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the window properly but does not pass the parameter. (this is part of a coldfusion template) <a href="##"
3
2359
by: ram | last post by:
how do I open a word document within a webform? I need to open the document within the form so the user can edit the document and then click on a button on the form (so that the document is automatically saved to a specified location on the server). thank you!
6
18230
by: mistral | last post by:
what is correct way open a PDF document in new window use hyperlink? I want show images thumbnails linked with PDF files, when click on thumbnail, PDF will be opened in new window. Some of PDF files are in the same web server, other are in a remote location. Any help will be appreciated.
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10167
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7544
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5566
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
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 we have to send another system
2
3730
muto222
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.