DITA and XMetaL Discussion
yz November 11, 2010 at 6:51 pm
Cross-referencing between two books (with PDF output)November 11, 2010 at 6:51 pmParticipants 4Replies 5Last Activity 11 years, 10 months ago
Is there a way for a topic in one book to cross-ref a topic in another book if I plan to transform each DITA book to a PDF? I imagine there is no elegant way to do this. Have others dealt with this issue? What is the best solution? Perhaps just create an external xref that simply opens the other PDF and explain in text which section/topic to look at? Thanks for any advice.
(using XMetaL 6 Author)Derek Read November 11, 2010 at 11:15 pm
Reply to: Cross-referencing between two books (with PDF output)November 11, 2010 at 11:15 pm
You might create a map that includes both “books”, but I suspect that is not what you want. You want two separate PDF documents and you want to be able to have one link to a portion of the other?
So, you need a feature provided by the PDF reader itself that will allow you to open to a specific page. Some PDF readers let you do that, including newer versions of Adobe “Reader” software. I would suggest searching the web for these terms “pdf link to specific page” to see what shows up. I have not reseached this too far, but the format supported by Adobe Reader seems to be straightforward.yz November 12, 2010 at 12:27 am
Reply to: Cross-referencing between two books (with PDF output)November 12, 2010 at 12:27 am
Thanks for the feedback. Yeah, I was guessing I'd have to go about it via a PDF editor, but I still wanted to verify that there were no tricks available while writing the source… Thanks!Derek Read November 12, 2010 at 5:19 am
Reply to: Cross-referencing between two books (with PDF output)November 12, 2010 at 5:19 am
Hmmm… I was thinking more that you should just need to construct the xref properly and that the DITA OT would hopefully give you the right link (which really looks like Adobe has designed to be an HTML-like link).
However, from the few (all negatively-worded) pages I've read (both from Adobe's website and others) the first step might be to decide if this is actually going to give acceptable results. From what I've read it looks like you might have a 25% success rate of end users seeing what you intend if PDF is the format (ie: they are using the right reader, the right version of that reader and maybe even in the right version of the browser, or not within a browser at all). I'm not sure if I would be personally happy enough with those odds and might pick a different strategy until this functionality was more universal.
I think getting this working with the DITA OT producing your PDF files should (in theory) just be a matter of creating an external xref. A test would be needed to make sure that will work, but since you can link to any external file format it should. The only tricky bit is to add the #page portion to the end. As I'm writing this I don't have access to a DITA OT or XMetaL so can't say, but I'll have a look when I can.
Linking to a specific page number should be easy if you know that what you are linking to is set in stone (and the page numbers won't alter). If you are linking to something that will change then Adobe's other concept of a 'destination' would make more sense to use. However, the DITA OT has no way to create 'destinations' in PDF files as far as I am aware, so if you need to produce such a PDF with the DITA OT the OT might need altering to do that.Derek Read November 12, 2010 at 5:44 am
Reply to: Cross-referencing between two books (with PDF output)November 12, 2010 at 5:44 am
To begin testing this I would do the following:
1) Insert an xref into your topic that will link to the existing PDF file.
2) Change the attributes to:
format = "pdf"
href = "myfile.pdf#page=3"
scope = "external"
3) Generate output to PDF.
Because the link is relative in this example both PDF files would need to be in the same folder (on the local machine or web server). If the PDF is at a different location you would obviously adjust that relative path, or perhaps (if it is on a different server) provide a full http://servername.com path.
As well, I think Adobe Reader by default gives a security warning for any links that take it to any other document (so your readers would also need to accept that annoyance).yz November 12, 2010 at 10:36 pm
Reply to: Cross-referencing between two books (with PDF output)November 12, 2010 at 10:36 pm
Derek — Thanks for the follow up info. Yes — I just happened to be going down that exact road this morning: regarding the external pdf #page=x technique. It seems to work in some but not all platforms and readers. But perhaps what we need to decide at this point is how badly we want to make these cross-references, since both books are changing frequently and the pages numbers are changing all the time. I don't think it will be worth the extra maintenance for us… we'll probably just reference the other book and section in plain text for now. Not such a big deal to us. Thanks again.
- You must be logged in to reply to this topic.