[xsl] Embedding/merging external PDF files with XSL-FO

Subject: [xsl] Embedding/merging external PDF files with XSL-FO
From: Sebastien <kamui.rouch@xxxxxxxxx>
Date: Mon, 10 Nov 2008 23:39:46 +0100
Hi !
I have my main XML file with all the data coming from my application
and i generate the PDF with FOP without any trouble.
But I have "third-party" files, most of them in PDF format, which I
have to import into the final PDF file. For images, I can use
fo:external-graphic, but for PDF, i'm stuck for now.
I thought it wasn't possible with XSL-FO to embed PDF, until i found this:
 - fox:external-document
which seems to support PDF as well as TIFF
 - hope for the future : "# add  Added generic structures to the PDF
library in order to support PDF file in fo:external-graphic later.
Committed by JM."

I tried both (fox:external-document and fo:external-graphic) but fop
fails for both with this message:
Reason: org.apache.xmlgraphics.image.loader.ImageException: No
ImagePreloader found for...
I'm using FOP 0.95 but i tried with the trunk's revision 712855 too.

I didn't really expect them to work as they seem to be work in
progress, but i was wondering whether there will be a chance to have
the capability to embed PDF with fop and xslfo anytime soon ?
Otherwise, how can i proceed to achieve what i want ?
 -Using an external program to merge pdf is not excluded but will be a
last resort solution as these external documents might not be always
appended or prepended to the final PDF but, instead, imported in the
middle of it, making the merge a real pain...
 -Asking my users to export their documents in JPG/PNG/TIFF makes
little sense when it comes to text document...
 -Converting all the PDF files into images seems to be a good
compromise but is a little bit "hackish"...
I would really love to do it in a "full XML way" (ie. with xslfo)

Here is a similar (short) discussion that happened a while ago:

Thanks in advance for your help.

Current Thread