Home Forums General XMetaL Discussion How to tell the number of pages in XMetal? Reply To: How to tell the number of pages in XMetal?


Reply to: How to tell the number of pages in XMetal?

If you're willing to process your XML source to get the number of pages and for some reason generating a pdf and inspecting the pdf is not good enough, I can imagine a macro that 1) processes the document using the DITA OT to produce a .fo version of the file, 2) Processes that .fo file using a renderer that is able to produce an XML representation of the pdf (this format is specific to the fo renderer, I know that XEP has one and believe that other renderers do to) and is unlike the fo in that it contains pagination information. 3) Parse that XML file and report back the total number of pages.

That's a way where you could do the whole thing programmatically. The only other way that I can think of would be to generate a pdf and then use something like iText http://www.lowagie.com/iText/ to look at the pdf and report back the number of pages (I'm assuming iText can do that…I haven't actually used it).

I'd have to wonder if it would be worth the trouble, but you can let your client decide that.