title: Images not showing in FlowDocument
body: <p>I'm struggling getting images to appear in a FlowDocument that is printed to PDF, to XPS or to a printer.</p>
  
  <p>I've studied this question, <a href="https://stackoverflow.com/questions/2425154/missing-images-in-flowdocument-saved-as-xps-document">Missing images in FlowDocument saved as XPS document</a>, but find the answer unsatisfying.</p>
  
  <p>Here is my code...</p>
  
  <pre><code>        PrintDialog pd = new PrintDialog();
          if(pd.ShowDialog() == true)
          {
              FlowDocument fd = new FlowDocument();
              fd.Blocks.Add(new Paragraph(new Run("Line 1")));
              Uri uri = new Uri("Images/globe.png", UriKind.Relative);
  //              Uri uri = new Uri(@"C:\...\Images\globe.png", UriKind.Absolute);
  //              Uri uri = new Uri("pack://application:,,,/Images/globe.png", UriKind.Relative);
              BitmapImage bi = new BitmapImage(uri);
              Image i = new Image();
              i.Height = 20;
              i.Width = 20;
              i.Source = bi;
  //                Image i = this.Resources["globeImage"] as Image;
              fd.Blocks.Add(new BlockUIContainer(i));
              fd.Blocks.Add(new Paragraph(new Run("Line 2")));
              pd.PrintDocument((fd as IDocumentPaginatorSource).DocumentPaginator, "A print document");
          }
  </code></pre>
  
  <p>Also, I have defined this resource...</p>
  
  <pre><code>    &lt;Image x:Key="globeImage" Source="Images/globe.png" Height="20" Width="20"/&gt;
  </code></pre>
  
  <p>So, the code as shown will not work.  The place were the image should be in the printed document is blank.</p>
  
  <p>Here is where it gets interesting...</p>
  
  <p>If I use the absolute uri, the image will appear.
  If I use the image defined in the windows resource, the image will appear.
  If I use the relative uri with pack uri notation, I get an exception: "image not found", event though this formulation will work fine in the XAML.</p>
  
  <p>So what is going on here?  According to the question I referenced, the problem is that the image is not loaded until shown on the screen.  If this is true, then why does the absolute URI path work? What is different about the way image sources work in XAML as opposed to programmatically.</p>