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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:28:21+00:00 2026-06-12T20:28:21+00:00

I have a PHP script which displays a PDF inside an object element. Adobe

  • 0

I have a PHP script which displays a PDF inside an object element. Adobe Reader plugins handle this fine and using the Adobe toolbar users can print the embedded PDF. However, some users insist on using the File menu (98% of users on Internet explorer 8) to print the HTML document. Utilizing this File->Print menu in IE, the HTML document is printed out without the contents (PDF) of the OBJECT element. (Print Preview) Using this method to print the document in Chrome or FF results in only the data currently shown in the Object viewport, to be printed. That is, a partial object and not the actual PDF.

I have searched and read a few related questions on StackOverflow, but nothing specific to this situation or case. Some of these ‘solutions’ use a Javascript method or function to print the content via a button or link. If I can’t get my users to use the Adobe toolbar in the browser to print a PDF, I doubt they’ll change their minds to use a button that says ‘PRINT’.

Why does the File->Print method in IE result in a blank page? Is there a way to make the browser print the contents of an Object element when using the File->Print menu. No JS hacks, buttons, links to ‘click here’, iframes, or suggestion to ‘display it inline’ etc.

For reference, the code for this ‘View PDF’ is below (which, again, works fine to display the PDF content in the object element; no issues).

echo "
<html>
 <head>
  <title>View PDF</title>
 </head>
 <body scroll='no'>
  <object data='getFile.php?f={$file_hash}' type='application/pdf' width='100%' height='100%' >
  <h2>Error: No PDF plugin</h2>
  <p>The browser does not have a PDF viewer installed.  In order to view the PDF in the browser, please <a href='http://get.adobe.com/reader'>download Adobe Reader</a>. </p>
  </object>
 </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-12T20:28:22+00:00Added an answer on June 12, 2026 at 8:28 pm

    As far as I know there is no solution for this issue. I have seen some developers “solving” the problem by generating a PDF file that automatically shows the print dialog when opened

    Another option could be to show the PDF file in a new window that removes the toolbar and menus in order to avoid the visual ambiguity.

    Window.open(url, "_blank", "location=0,menubar=0,toolbar=0");
    

    I do not know if this one works, but you could try detecting the browser print event, then calling pdfDoc.printAll(); on your Acrobat Reader object.

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

Sidebar

Related Questions

I have created this php script which displays the contents of a designated directory
Here I have a simple php script which displays some values from a database
I have this PHP script which i'm grabbing images from a directory and displaying
I have a script which similar to this: foo.php class Foo { function Foo()
I have this script that displays all the users images which i will display
I have a PHP/PostgreSQL/Oracle-script which displays links as tags, which can be clicked to
I have a php script which records an impression then displays an image. //
I have a php script with an array which loops through months and displays
I have a php script which saves the original image, then resizes it -
I have a PHP script which creates and listens on a port for connections

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.