Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > display pdf in new window

Reply
Thread Tools

display pdf in new window

 
 
timothy ma and constance lee
Guest
Posts: n/a
 
      09-04-2004
Sirs

I got the problem how to display a generated pdf file into a new windows in
xml using javascript: window.open

My program is in this way:

<form= abc action=1.servlet>
</form>

onclick="javascript:document.abc.submit"

But it opens a pdf file in the same window so my original one is overriden


 
Reply With Quote
 
 
 
 
DU
Guest
Posts: n/a
 
      09-04-2004
timothy ma and constance lee wrote:
> Sirs
>
> I got the problem how to display a generated pdf file into a new windows in
> xml using javascript: window.open
>
> My program is in this way:
>
> <form= abc action=1.servlet>
> </form>
>
> onclick="javascript:document.abc.submit"
>


comp.lang.javascript FAQ
Referencing Forms and Form Controls.
The Most Common Mistake
http://www.jibbering.com/faq/faq_not....html#faComMis

> But it opens a pdf file in the same window so my original one is overriden
>
>


<script type="text/javascript">
var WindowObjectReference = null;
function OpenRequestedPDFFile()
{
if(WindowObjectReference == null || WindowObjectReference.closed)
{
WindowObjectReference = window.open("path/filename.pdf",
"PDFWindowName", "location,menubar,resizable,scrollbars,status" );
}
else
{
WindowObjectReference.focus();
};
}
</script>
</head>
<body>
....
<form name="FormName" action="1.servlet" onsubmit="OpenRequestedPDFFile();">
[...]

<p><input type="submit" value="Submit the form">Note that the submission
of the form will open a new window loading a <img src="PDFIconLogo.gif"
width="..." height="..." alt="PDF" title="PDF" style="cursor:
customizedPDF.cur, auto;"> file and starting Adobe Acrobat Reader in
that new window. [...file size...]KB</p>
</form>

Not tested.

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Netscape 7.2
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Open new window and display PDF document... Moe Sisko ASP .Net 0 06-04-2008 01:28 AM
Re: Open new window and display PDF document... Norman Yuan ASP .Net 0 06-03-2008 06:19 PM
Postscript to PDF with pdf-tools, pdf-writer, or other Sean Nakasone Ruby 1 04-14-2008 09:13 PM
PDF::Writer, create pdf and insert in other pdf file. Ricardo Pog Ruby 1 03-26-2008 08:24 PM
Display PDF (or other file) in new browser window =?Utf-8?B?Y2hhem1hbmlhbg==?= ASP .Net 1 06-04-2004 02:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57