Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7842073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:14:09+00:00 2026-06-02T16:14:09+00:00

I have a web page (SSL) that contains a barely visible iframe whose source

  • 0

I have a web page (SSL) that contains a barely visible iframe whose source is a PDF streamed from a Java servlet. The purpose of the barely visible iframe is to render a PDF which opens a print dialog box right away when the page is loaded.

This process is working in a sporadic manner. More often than not, when the page is loaded, the PDF print dialog box comes up correctly. Occasionally, though, the PDF print dialog box is never rendered when the page loads. I know it’s not an issue in the Java servlet as I can verify from the logs that the PDF is streamed correctly to the calling page. I need to find a way to make it 99.9999…….% reliable if at all possible that the PDF print dialog ALWAYS opens when the page is loaded. So, I’m looking for any tips on how to ensure that this will happen.

This needs to work for Internet Explorer (version 8 in particular).

This is the JavaScript that opens the page that contains the PDF iframe:

function openPrintCheckWindow(){
    pc=window.open("/print_check.jsp", "pc", "toolbar=no,scrollbars=no,resizable=no");
    pc.resizeTo(1000,700);
    pc.moveTo(80,80);
}

Here’s the source for the page that contains the PDF iframe:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
    <TITLE></TITLE>

    <style> 
    #createpdf {
        position:absolute;
        top:0; 
        right:0; 
    }
    .micr {
        font-family: "MICR Encoding", sans-serif;
        font-size: 0.2in;
    }
    </style>

    <script type="text/javascript"> 
    function doAlert(msg){
    if(msg.length>0){
        alert(msg);
    }
    }

    //doesn't block the load event
    function createIframe(){
        var i = document.createElement("iframe");
        i.src = "/PrintCheckServlet";
        i.width = "2px";
        i.height = "2px";
        document.getElementById("createpdf").appendChild(i);
    };

    // Check for browser support of event handling capability
    if (window.addEventListener)
        window.addEventListener("load", createIframe, false);
    else if (window.attachEvent)
        window.attachEvent("onload", createIframe);
    else 
        window.onload = createIframe;
    </script>

</HEAD>

<BODY BGCOLOR="#DFD9D0" TEXT="#000066" onLoad="doAlert('')">
    <FORM METHOD="POST" TARGET="main_window" ACTION="ControllerServlet">            
    <P ALIGN="LEFT">
        <INPUT TYPE="BUTTON" NAME="CLOSE" VALUE="Close" 
         onClick="this.form.submit();window.close();window.opener.focus();window=null;">
        <br />
        <H3 id="print_message">A print dialog box will show momentarily</H3>
    </P>
    <div id="createpdf"></div>
    </FORM>
</BODY>
</HTML>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:14:10+00:00Added an answer on June 2, 2026 at 4:14 pm

    Are you OK with assuming that whoever is viewing your file is using Acrobat Reader or some other “javascript-enabled” PDF reader?

    If that is the case, you could then modify your file and generate a PDF that automatically prints instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web page that accepts an excel file, reads data from it
I have web forms page that has 2 controls. A gridview and an associated
I have a web page that includes a bunch of images. Sometimes the image
I have a web page which contains a select box. When I open a
I have a web page with DIV s with a mouseover handler that is
I have a web page that displays a long line graph inside a div
I have a web page that is being displaying in a winform app using
I have a TYPO3 Web site that needs to have its home page (and
We have a third-party external web page on another domain that we're loading in
I have a client program that talks to a web server through a SSL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.