groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] gropdf and pdfroff


From: Deri James
Subject: Re: [Groff] gropdf and pdfroff
Date: Thu, 28 Jul 2011 18:48:16 +0100
User-agent: KMail/1.13.7 (Linux/2.6.38.8-desktop-4.mga; KDE/4.6.3; x86_64; ; )

On Thursday 28 Jul 2011 18:02:32 Ralph Corderoy wrote:
> Hi Deri,
> 
> > In a pdf every page is an object and the page order is given in an
> > array called "kids" which is an attribute of the "pages" object. So to
> > reorder the pages in a pdf is simply a case of reordering this array
> > before it is written to the file. Currently I just push each new page
> > onto the end of the kids array, but it might be better to introduce a
> > pair of "\X pdf:" commands which alter the insertion point for all
> > following pages. Something along the lines of:-
> > 
> > \X pdf: pagename <name> \" name a location in the file
> > \X pdf: switchtopage (before|after) <name> \" start inserting pages
> > before/after the named page.
> 
> Would it be better to leave the re-ordering to external utilities, e.g.
> the pdftk package
> 
>     http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
> 
> on the basis of do one small thing and do it well?
> 
> Cheers, Ralph.

Hi Ralph,

Yes, pdftk probably works in a similar way (reordering the kids array). The 
problem would be if the cover sheet was in fact more than one page (or the TOC 
at the end went exceeded 1 page) it would be difficult to work out (in a 
program) the proper parameters to pass to pdftk to reorder the pages so the 
TOC appears after the cover.

Another good programmer's rule says that the best place to do something is "as 
soon as you can". Which places it in the domain of the document creator 
(gropdf). It's not really a radical new feature, more exposing an api to add 
pages in a non-linear fashion.

Cheers 

Deri



reply via email to

[Prev in Thread] Current Thread [Next in Thread]