title: Setting the URL resolver directory when using a generated XHTML document?
body: <p>Here's my current workflow:</p>
  
  <ol>
  <li>Load POJOs from the database.</li>
  <li>Pass them into Velocity, rendering a HTML template in-memory.</li>
  <li>Then render the outputted HTML to a PDF using Flying Saucer and iText.</li>
  </ol>
  
  <p>The problem occurs when I try to resolve relative URLs like images and the like. Since my document lives in memory, it doesn't know how to resolve images or stylesheets at all. How can I set the document for it to an in-memory String object while still passing it a directory to load resources from? </p>
  
  <pre><code>String velocityOutput = VelocityEngineUtils.mergeTemplateIntoString(...);
  
  ByteArrayOutputStream output = new ByteArrayOutputStream(...);
  
  ITextRenderer renderer = new ITextRenderer();
  renderer.setDocumentFromString(velocityOutput);
  renderer.layout();
  renderer.createPDF(output);
  </code></pre>
  
  <p>I need to do everything in-memory as I'm simply generating the report to be emailed to clients. How can I make an <code>&lt;img src="..."/&gt;</code> resolve a relative URL in my HTML template when generated to a PDF? </p>