title: fit pdf file into web view in iOS
body: <p>I want to show pdf file into my web view.Webview may contains only text or text+pdf,text+images,etc.</p>
  
  <p>It is working fine for me but <strong>when the web view has pdf then its height &amp; width are not fit as per web view frame. I have scroll horizontally &amp; vertically to see it. Also if pdf has multipage then its height is not adjust.</strong></p>
  
  <p><strong>Try 1</strong></p>
  
  <pre><code>web.scalesPageToFit=YES;
  </code></pre>
  
  <p>problem: All content is very small &amp; looks very ugly.</p>
  
  <p><strong>Try 2</strong></p>
  
  <pre><code>[web setContentMode:UIViewContentModeScaleAspectFit];
  [web setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth];
  </code></pre>
  
  <p>Problem: Not working</p>
  
  <p><strong>Try 3</strong></p>
  
  <pre><code>[web loadHTMLString:[NSString stringWithFormat:@"&lt;html&gt;&lt;head&gt;&lt;meta name='viewport' content='width:05px; initial-scale=0.5; maximum-scale=1.0; user-scalable=0;'/&gt;&lt;/head&gt;
  &lt;body&gt;&lt;div style='font-size:14px; font-family:Opensans';&gt;
  &lt;object style='width:100%; height:100%' type='application/pdf' data='http://www.eecs.harvard.edu/econcs/pubs/online.pdf'&gt;&lt;/object&gt;&lt;p&gt;ab sofort!&lt;/p&gt;&lt;/div&gt;
  &lt;/body&gt;&lt;/html&gt;"] baseURL:nil];
  </code></pre>
  
  <p>Problem: Not working, pdf is only shows half part.</p>
  
  <p><strong>Try 4</strong></p>
  
  <pre><code>[web_large loadHTMLString:@"&lt;object style='width:620px; height:950px' type='application/pdf' data='http://www.eecs.harvard.edu/econcs/pubs/online.pdf'&gt;&lt;/object&gt;&lt;p&gt;ab sofort!&lt;/p&gt;\n" baseURL:nil];
  </code></pre>
  
  <p>Problem: width is scrollable horizontally &amp; height is fixed so not working for multi page pdf.</p>
  
  <p><strong>Thanks</strong></p>
  
  <p><strong>Any answer please</strong></p>