title: Open embedded PDF from AIR
body: <p>What's the recommended solution, to <strong>open an embedded</strong> <a href="/questions/tagged/pdf" class="post-tag" title="show questions tagged &#39;pdf&#39;" rel="tag">pdf</a> document with Acrobat (or any other reader). I've followed a similiar question <a href="https://stackoverflow.com/questions/4050898/openwithdefaultapplication-fails-on-files-in-application-folder">openWithDefaultApplication fails on files in application folder</a>, but this seems not to work.</p>
  
  <pre><code>var filename = "John_Doe-tax_return_2011.pdf"; // = my filename
  
  var realFile:File = File.applicationDirectory.resolvePath(filename); 
  var tempFile:File = File.createTempFile(); 
  
      realFile.copyTo(tempFile,true); 
      tempFile.openWithDefaultApplication();
  </code></pre>
  
  <p>I've tested it all, so it's not a directory issue</p>
  
  <pre><code>trace(tempFile.extension) // &gt; tmp (?? tempFile.extension = "pdf" doesn't works)
  trace(realFile.exists)    // &gt; true (original pdf-document exists!)
  </code></pre>