Embed PDF within a PDF?

Post here questions and problems related to editing and publishing DITA content.
laurakatajisto
Posts: 5
Joined: Thu Dec 10, 2015 10:35 pm

Embed PDF within a PDF?

Post by laurakatajisto »

Hi,

We have a case where we would need to embed PDFs in a PDF. The embedded PDFs may be of the same size, or of a different size, than the PDF that we are trying to publish from DITA. The embedded PDFs are all ready objects.

I know I can do this with topicref and the PDF is nicely added when I'm publishing HTML:
<topicref href="test_trifold.pdf" format="pdf" locktitle="yes" navtitle="Trifold PDF"/>

Can the same work with PDF publishing? I'm sure it's not out of box behaviour, but would it be technically possible?

Regards,
Laura
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Embed PDF within a PDF?

Post by Radu »

Hi Laura,

If inside a DITA topic you refer to the PDF with a DITA <image> reference, the default PDF publishing should expand the referenced PDF in the main PDF.
Otherwise, if you want to go with the topicref approach, you somehow need an XSLT customization to produce in the final XSL-FO output a construct like:

Code: Select all

<fox:external-document src="my-doc.pdf"/>
or:

Code: Select all

<fo:external-graphic src="my-doc.pdf#page=1"/>
This is usually done for PDF vectorial images (so PDFs with a single page of content inside) so I'm not sure how well this works for PDFs with multiple pages, for example the page counter may not properly work.
Maybe you could also ask around on the DITA Users list, there may be people there who encountered the same problem and have better solutions than what I proposed.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply