PDF popup with close button

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • moose

    #1

    PDF popup with close button

    OK
    Popup window? No problem
    PDF in popup? No problem

    But what about a couple of Close Window buttons?
    Imagine a "Close Window" button at the top of the popup page.
    Then the PDF which can scroll. And another "Close Window" button
    at the bottom of the page.

    Any suggestions for completing this task?
  • McKirahan

    #2
    Re: PDF popup with close button

    "moose" <sky_diver_@exc ite.com> wrote in message
    news:5725cfe.04 09270813.6c1748 08@posting.goog le.com...[color=blue]
    > OK
    > Popup window? No problem
    > PDF in popup? No problem
    >
    > But what about a couple of Close Window buttons?
    > Imagine a "Close Window" button at the top of the popup page.
    > Then the PDF which can scroll. And another "Close Window" button
    > at the bottom of the page.
    >
    > Any suggestions for completing this task?[/color]

    Will this help you; watch for word-wrap.

    <html>
    <head>
    <title>popupPDF .htm</title>
    <script type="text/javascript">
    function popupPDF() {
    var pdf = "http://www.google.com/";
    var htm = "<html><head><t itle>popupPDF</title>";
    htm += "</head><body>";
    htm += "<a href='javascrip t:window.close( )'>Close</a>";
    htm += "<iframe src='" + pdf +"'></iframe>";
    htm += "<a href='javascrip t:window.close( )'>Close</a>";
    htm += "</body></html>";
    var win = window.open("", "popupPDF", "");
    win.document.wr ite(htm);
    win.close;
    }
    </script>
    </head>
    <body>
    <a href="javascrip t:popupPDF()">P opup PDF</a>
    </body>
    </html>


    Comment

    • Richard Hijdra

      #3
      Re: PDF popup with close button

      > OK[color=blue]
      > Popup window? No problem
      > PDF in popup? No problem
      >
      > But what about a couple of Close Window buttons?
      > Imagine a "Close Window" button at the top of the popup page.
      > Then the PDF which can scroll. And another "Close Window" button
      > at the bottom of the page.
      >
      > Any suggestions for completing this task?[/color]
      One can also use the cross on the top right side of the window ;-)
      You can also float a close button (or image) above the PDF in one corner
      AFAIK

      Richard

      Comment

      • McKirahan

        #4
        Re: PDF popup with close button

        "McKirahan" <News@McKirahan .com> wrote in message
        news:5VX5d.3381 5$He1.945@attbi _s01...[color=blue]
        > "moose" <sky_diver_@exc ite.com> wrote in message
        > news:5725cfe.04 09270813.6c1748 08@posting.goog le.com...[color=green]
        > > OK
        > > Popup window? No problem
        > > PDF in popup? No problem
        > >
        > > But what about a couple of Close Window buttons?
        > > Imagine a "Close Window" button at the top of the popup page.
        > > Then the PDF which can scroll. And another "Close Window" button
        > > at the bottom of the page.
        > >
        > > Any suggestions for completing this task?[/color]
        >[/color]

        You've asked for a "Close" button not a link:

        <html>
        <head>
        <title>popupPDF .htm</title>
        <script type="text/javascript">
        function popupPDF() {
        var pdf = "http://www.google.com/";
        var htm = "<html><head><t itle>popupPDF</title>";
        htm += "</head><body><cen ter>";
        htm += "<input type='button' value='Close'
        onclick='window .close()'>";
        htm += "<br><br>";
        htm += "<iframe src='" + pdf +"'></iframe>";
        htm += "<br><br>";
        htm += "<input type='button' value='Close'
        onclick='window .close()'>";
        htm += "</center></body></html>";
        var win = window.open("", "popupPDF", "");
        win.document.wr ite(htm);
        win.close;
        }
        </script>
        </head>
        <body>
        <a href="javascrip t:popupPDF()">P opup PDF</a>
        </body>
        </html>


        Comment

        • Grant Wagner

          #5
          Re: PDF popup with close button

          moose wrote:
          [color=blue]
          > OK
          > Popup window? No problem
          > PDF in popup? No problem
          >
          > But what about a couple of Close Window buttons?
          > Imagine a "Close Window" button at the top of the popup page.
          > Then the PDF which can scroll. And another "Close Window" button
          > at the bottom of the page.
          >
          > Any suggestions for completing this task?[/color]

          <a href="loadpdf.c gi?pdf=somefile .pdf"
          target="_blank"
          onclick="window .open(this.href , this.target,
          '..attributes.. ');return false;"[color=blue]
          >Open somefile.pdf in a new window (maybe, if you haven't[/color]
          disabled that functionality on your browser)</a>

          Then have loadpdf.cgi output (using an ASP example, you could use
          PHP, or Perl, or JSP, or ColdFusion, or any other server-side
          technology for this):

          <html>
          <head>
          <title>Window containing <%= Request.Value(' pdf') %></title>
          </head>
          <body>
          <!-- your close buttons and stuff -->
          <layer src="<%= Request.Value(' pdf') %>"><iframe src="<%=
          Request.Value(' pdf') %>"></iframe></layer>
          <!-- more buttons or whatever -->
          </body>
          </html>

          You probably want some dimensions on the <layer> or <iframe> to make
          it bigger than the default size. But remember, the window may not be
          the size _you_ specify. Many browsers can honor your window.open()
          request but still not provide a window the size, position and with
          the chrome you requested.

          --
          Grant Wagner <gwagner@agrico reunited.com>
          comp.lang.javas cript FAQ - http://jibbering.com/faq

          Comment

          Working...