title: How to embed external pdf/txt file into another using XSL-FO?
body: <p>Is it possible to embed an external PDF or TEXT document into a master PDF by using XSL-FO/XSLT?</p>
  
  <p>I have xslt stylesheet to produce PDF documents. But, the input XML contains inlined TEXT or Base64 encoded PDF documents. So what I do in my HTML version of my stylesheet I extract the TEXT or PDF and dump it on disk. Then in the xslt I have this:</p>
  
  <pre><code>&lt;xsl:when test='(n1:text/@mediaType="application/pdf") or (n1:text/@representation="B64")'&gt;
      &lt;IFRAME name='documentFrame' id='documentFrame' WIDTH='100%' HEIGHT='65%' src='{$DOC_URI}'/&gt;
  &lt;/xsl:when&gt;
  </code></pre>
  
  <p>For HTML conversion it is working perfectly. Is it possible to achieve the same result (embed document) inside a PDF? I have an XSLT for pdf generation but have been unsuccessful at accomplishing the same result.</p>
  
  <p>I have tried add-ons for Apache FOP like this one (<a href="http://www.jeremias-maerki.ch/development/fop/index.html" rel="noreferrer">PDF Image Support</a>):</p>
  
  <pre><code> &lt;fox:external-document src="my-doc.pdf"/&gt;
  </code></pre>
  
  <p>Apparently it is only for images.</p>
  
  <p>Any hints?</p>
  
  <p>Thank you </p>