title: Saving a Dynamically Generated PDF Using Java
body: <p>I have a URL that causes a web server to generate a PDF when opened.  Is it possible to save this PDF document to disk (client side), using Java?  I found lots of examples for doing this when the PDF already exists as a document on the web server, but the code for these examples does not seem to work in the case where the web server doesn't begin to create the content until the link is opened (at least that is my impression at this point).</p>
  
  <p>There is a link that I can click to produce the PDF. The HREF for that link is:</p>
  
  <pre><code>&lt;a href="javascript:open_window('ReportDisplay.cfmincidentID=223189&amp;amp;cs=377041B‌​A2467C3CEA7FD989A12126E0E&amp;amp;services=2815&amp;amp;format=1&amp;amp;UniqueID=651F76E4E56‌​91207B9B2AF1F51A780AA')"&gt;
      &lt;img src="../../Images/pdf-small.gif" alt="Report" border="0" height="15" width="15"&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I construct a complete URL, including the protocol and such, and I can paste that complete URL into the location bar of the browser. This does in fact produce the PDF in the current window. So, this is what I'm trying to capture into a file on my local disk.</p>