Re: [xep-support] Rendering DocBook sets as multiple documents

From: Bob Stayton (
Date: Mon Sep 08 2003 - 00:40:41 PDT

  • Next message: Johann Richard: "[xep-support] "Table Continued" Extension"

    On Sun, Sep 07, 2003 at 09:22:12PM -0400, G. Ken Holman wrote:
    > At 2003-09-08 10:07 +1000, Kevin Yank wrote:
    > >I am starting work on a DocBook XML project that will be published as a two
    > >volume set of books. Each of these books must contain an index to both
    > >books, with page number citations of the form "I-123" for page 123 of volume
    > >I.
    > >
    > >DocBook XML appears to have all the tools to model this. I can enclose the
    > >two <book>s in a <set> and end both <book>s with a <setindex>.
    > >
    > >Things are less straightforward when it comes to the rendering process,
    > >though. As far as I can tell, XSL-FO in general and XEP in particular don't
    > >let you produce two output documents from a single source document in one
    > >process, do they?
    > True, XSL-FO is defined for only one process. Cross references used for
    > page number citations are to locations inside of the area tree, and there
    > is only one area tree in a process.
    > >I would appreciate any suggestions on how to go about producing two
    > >PostScript output files which share page number citations as described
    > >above.
    > Would you accept a single PostScript file with both volumes, the second one
    > starting at page 1, and splitting the resulting file in two? Or creating a
    > PDF from the PDF and then splitting the PDF into two using a publicly
    > available PDF library like iText?
    > Because the process works over only a single FO file you will get your
    > "cross-volume" references resolved correctly.
    > My approach would be three sets of pages in one output FO file: volume 1, a
    > magic one-page signal file, then volume 2. I would then produce the PDF
    > from the PostScript and write a Python program accessing the iText library
    > in Java through Jython, streaming the pages of the PDF to a volume 1 output
    > file, tripping over the magic page as a signal to start volume 2, then
    > putting the rest of the pages of the PDF file out to a volume 2 output
    > file. I suppose if I really needed PostScript results I could probably go
    > from the PDF to PostScript, but I've never researched how that might be ...
    > of course if there were a library that split PostScript files then I would
    > just split the result and not bother with the PDF.

    You don't need a library. Properly structured PostScript
    like XEP's is trivial to split up. I've used Perl or even
    awkward awk. First, There is the prolog at the beginning
    of the file that needs to get stuffed into both of the
    output files:


    and then the physical page boundaries can
    be split on these PostScript comments:

    %%Page: n n

    The only trick is to figure out on which page to switch over
    to the second file.

    Bob Stayton                                 400 Encinal Street
    Publications Architect                      Santa Cruz, CA  95060
    Technical Publications                      voice: (831) 427-7796
    The SCO Group                               fax:   (831) 429-1887
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service

    This archive was generated by hypermail 2.1.5 : Mon Sep 08 2003 - 01:52:55 PDT