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 5950949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:28:00+00:00 2026-05-22T17:28:00+00:00

I am able to use javascript to print PDF file in Internet Explorer and

  • 0

I am able to use javascript to print PDF file in Internet Explorer and Firefox, as such:

<script type="text/javascript">
<!--
if (navigator.appName == 'Microsoft Internet Explorer')
{
    document.write('<object id="agreementPDF" type="application/pdf" data="file.pdf" width="100%" height="500"></object>');
}
else
{
    document.write('<iframe id="agreementFrame" src="file.pdf" width="100%" height="500px"></iframe>');
}
//-->
</script>

<script type="text/javascript">
<!--
function printAgreement()
{
    if (navigator.appName == 'Microsoft Internet Explorer')
    {
        document.getElementById('agreementPDF').print();
    }
    else
    {
        var agreement = document.getElementById('agreementFrame');
        agreement.focus();
        agreement.contentWindow.print();
    }   
}
//-->
</script>

<input type="button" name="print" onclick="printAgreement();" value="Print" />

However, in Opera, the print function does not work.

How do I make it work?

Thanks.

  • 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-05-22T17:28:01+00:00Added an answer on May 22, 2026 at 5:28 pm

    Looks like Opera needs a little more hand holding when it comes to the print dialog. Here are some very similar questions previously asked/answered on stackoverflow:

    window.print not working with opera browser

    print() not working on opera browser

    Print iframe content in Opera and Chrome

    Seems like you either need to use a different *.print() function or trigger the event after the page has finished loading.

    Hope these links help.

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

Sidebar

Related Questions

I am not able to use the breakpoint in Studio with Javascript. I'm able
I want to be able to use Python to open a .csv file like
My goal is to be able to use $obj like this: print $obj->hello() .
I'm trying to use CSS ( under @media print ) and JavaScript to print
I'm using the FireFox API to write to a binary file from my JavaScript
I have an app that needs to be able use either an sqlite3 datebase
I am able to use the NHibernate Criteria API for an IN statement using
Requirements: Must be able to use C strings as well as C++ strings Fast
The init() is able to use the parameter passed to it in this example:
I need to be able to use https to connect to a server and

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.