title: Eliminate scroll-bars and fit embedded pdf into my jquery dialog
body: <p><strong>What am i doing :</strong></p>
  
  <p>I'am developing a pdf reader on my website and on my homepage i have a number of e-books cover photos rendered and when a user click on a particular e-book , a jquery ui dialog appears and i render the pdf using <a href="http://pdfobject.com/" rel="nofollow noreferrer">pdfobject library</a>.</p>
  
  <p><strong>What i achieved :</strong></p>
  
  <p>On clicking the icon of e-book , iam able to render the pdf object in the dialog.</p>
  
  <p><strong>The problem :</strong> </p>
  
  <p>The display looks very bad.There are scroll bars in the pdf embededd object as well as the jquery dialog has scroll bar (verical and horizontal).</p>
  
  <p><strong>What i want :</strong></p>
  
  <p>my jquery dialog has width = 600 and height = 500 , when i first open the dialog there should just be 1 vertical scroll bar , the first page of pdf should fit into the exactly my dialogs default dimensions (600 X 500) irrespective how much are its orignal dimensions.
  If a pdf has only 1 page , there should be no scroll bars (unless the user clicks zoom-in)</p>
  
  <p><strong>Javascript code :</strong></p>
  
  <pre><code>$(function() {
      $( "#pdfPrompt" ).dialog({
          autoOpen: false,
          show: "blind",
          hide: "explode",
          width:600,
          height:500,
          resizable : false
      });
  
      $( "#opener" ).click(function() {
          $( "#pdfPrompt" ).dialog( "open" );
              var myPDF = new PDFObject({ url: "sample.pdf" }).embed('renderer');
  
          return false;
      });
  });
  </code></pre>
  
  <p>opener is just the id i give to icon, and pdfprompt is a simple <code>&lt;div&gt;</code></p>
  
  <p>Example : </p>
  
  <p><img src="https://i.stack.imgur.com/1tRID.jpg" alt="This is what is happening"></p>
  
  <p>After trying out charlietfl's solution(jsFiddle) :<img src="https://i.stack.imgur.com/q3RhR.jpg" alt="enter image description here"></p>
  
  <p>Can you'll please help me to achieve this ,Thank you</p>