DITA and XMetaL Discussion
XMetaL Community Forum › DITA and XMetaL Discussion › Can you pull a PDF file into a bookmap?
-
mtbowers August 30, 2011 at 6:53 pm
Can you pull a PDF file into a bookmap?
August 30, 2011 at 6:53 pmParticipants 5Replies 6Last Activity 11 years, 6 months agoNeed help with this one. I have an XMetal bookmap containing all the topics for a hardware manual. We have specs/drawings that are in PDF format only (8.5×11″) and we want to pull the PDFs straight into the bookmap and the manual so that they appear as-is (no header/footer as in the rest of the pages in the manual) and they are very easy to update when new drawings come out. Converting them to another image format isn't an option for us right now. Is this possible? And if so, how?
Derek Read August 30, 2011 at 8:15 pm
Reply to: Can you pull a PDF file into a bookmap?
August 30, 2011 at 8:15 pmRenderX XEP (used by XMetaL Author Enhanced PDF via RenderX XEP deliverable) supports the embedding of PDFs within other PDFs, so yes, this would be possible. As it works right now if you create a topic, embed an
and reference a PDF file RenderX will attempt to embed the PDF inside the PDF that it is generating. There are limitations to this as XMetaL Author Enterprise and the DITA Open Toolkit are not really designed with this in mind, but you can get around those issues. To see this in action you can do the following:
1. Save your PDF to an empty folder (example: C:EmbedTesttest.pdf)
2. Create a DITA topic in the same folder:
PDF Embedding Test
id="image_FA6E1C37A0C14E358ED583ADE0A2C8E8"
placement="inline"
width="340px"
height="440px">
3. Generate output from the topic using the deliverable “XMetaL Enhanced PDF via RenderX XEP”. At this point if you open the output PDF you will notice that the embedded PDF image is not there. This is because by default the DITA OT only copies certain image types (certain file extensions like JPG and GIF) into the right place for RenderX to locate them when it goes to embed them in the output PDF.
4. Manually copy the file “test.pdf” into the following folder:
C:EmbedTestpdf_outCustomizationOpenTopiccommonartwork
5. Generate output again, using “XMetaL Enhanced PDF via RenderX XEP”. This time the PDF image will be embedded inside your output PDF. I'm attaching both the test.pdf and my for reference.You will note several issues with the above test because of the way the DITA OT currently works:
1. The image is included inside a topic and so appears on a page along with header and footer (exactly what you don't want).
2. The image has been scaled in order to fit on the page (“actual size” is 8.5 x 11inches in PDF land, but I have scaled it to 340x440px). RenderX and the DITA OT do not automatically scale images that do not fit inside a particular container block (this is in the XSL-FO). There are strategies for that, but in your case this would likely not be needed if your pages are all exactly the right size.
3. The DITA OT doesn't automatically copy the PDF image into the right place for RenderX to locate it.So, to get what you are looking for would require customization work to be done to the DITA Open Toolkit. You may also need to decide how you wish to code the DITA map or specially coded topics that will contain references to these PDF files (a DITA specialization might make coding any XSLT easier but creating the specialized DTD would in itself add more work). These decisions would drive the changes needed in the XSLT that generates the XSL-FO used by RenderX to generate the PDF output (or the latter might drive the former). You might be able to get away with markup similar to what I have above, perhaps by adding a special identifier that can be used by the XSLT so that it knows this is a special topic and to generate the right XSL-FO for it. Perhaps something like this:
href=”test.pdf”
id=”image_FA6E1C37A0C14E358ED583ADE0A2C8E8″
placement=”inline”>Alternatively (as you suggest) you might alter the code that handles bookmap files, so that you might have something like this in your bookmap:
These things would likely be a significant amount of work and a service one of our partners may be able to help with if you don't have anyone in house that is familiar with making changes to the DITA OT. Or you might be lucky and someone else may have already done something like this that they are willing to share. Two possible other locations for this type of information:
http://tech.groups.yahoo.com/group/dita-users/
http://tech.groups.yahoo.com/group/xmetal-dita/Also note that in order to view the PDF inline while editing in XMetaL Author Enterprise would require customization of the editor itself. This would require some scripting work and a configuration changes but it can be done. Though I suspect it may not be a requirement in your case and that generating output is higher priority. This is also something our partners can generally help with.
mtbowers August 30, 2011 at 9:42 pm
Reply to: Can you pull a PDF file into a bookmap?
August 30, 2011 at 9:42 pmThanks for the quick response! I will give this a try. Related to this topic (and I suppose the inherent limitations on just using the editor instead of modifying DITAOT); is it possible to create a different header/footer for this set of drawings? For example, the rest of my book has the standard XMetal book header/footer; however, I'd like this section (if I need to have a header/footer) to be date revised or something similar. As an analog, you can do this in MS Word by breaking up the document into sections and turning off the copy footer/header info from section to section.
gcrews August 30, 2011 at 10:09 pm
Reply to: Can you pull a PDF file into a bookmap?
August 30, 2011 at 10:09 pmFYI, if you output to chm as well you may run into this issue:
There appears to be an issue with embedded files in CHM files and IE9.
http://social.technet.microsoft.com/Forums/bg-BG/w7itpronetworking/thread/2cd262
dc-54d5-4929-8ae8-61d2c1aad11bDerek Read August 30, 2011 at 10:56 pm
Reply to: Can you pull a PDF file into a bookmap?
August 30, 2011 at 10:56 pmYou could probably create separate pages with different headers and footers but this would be fairly tricky given the way the DITA OT has designed the page layout ordering (this is driven mostly by a file called layout-masters.xsl). You basically have body-even and body-odd pages. You might have to add new ones to do what you want.
mchaursiya September 17, 2015 at 11:13 am
Reply to: Can you pull a PDF file into a bookmap?
September 17, 2015 at 11:13 amHello,
I'm having same kind of requiremen.t where need to pull a pdf into bookmap and embed same into final pdf otuput.
Could you please help me, since you were having same kind of requirement in past…
I've a requirement where need to add pdf in the topicref
in bookmap file and using the FOP processor to write the pdf from DITA-OT using Oxygen. At the end we wanted to embed this attached pdf into the final pdf outout…
thank you!
Derek Read September 18, 2015 at 11:51 pm
Reply to: Can you pull a PDF file into a bookmap?
September 18, 2015 at 11:51 pmIf you are using oXygen's integration with the DITA OT to produce your output then your best bet for getting good information is from their support team.
-
AuthorPosts
- You must be logged in to reply to this topic.