[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] gropdf and pdfroff
From: |
Deri James |
Subject: |
[Groff] gropdf and pdfroff |
Date: |
Thu, 28 Jul 2011 17:23:39 +0100 |
User-agent: |
KMail/1.13.7 (Linux/2.6.38.8-desktop-4.mga; KDE/4.6.3; x86_64; ; ) |
pdfroff is a very clever and useful utility in groff and I'd appreciate advice
on how best to integrate it into gropdf. Currently gropdf includes its own
pdfmark macros which are intended as a drop in replacement for pdfmark.tmac,
in fact most of the macros are based on Keith Marshall's work.
Pdroff does the following:-
A) Resolves all forward references by having multiple groff runs.
B) Allows an optional cover sheet to be included as a frontispiece (--
stylesheet).
C) Relocates the TOC to the 2nd page.
The first two functions are already implemented by doing:-
groff -M. -mspdf2 -ms -T pdf -dPDF.EXPORT=1 -z cover.ms pdfmark.ms 2>&1 | groff
-M. -mspdf2 -ms -Tpdf - cover.ms pdfmark.ms | okular -
Where spdf2 is a slightly tweaked version of Keith's spdf.tmac (which works
with both the grops and gropdf back ends).
The main difference is that the Table of Contents is not automatically
relocated, and it is on this I would like advice.
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.
If this was implemented any macros which include a TOC generator could be
amended to position the TOC anywhere in the document, and if not using gropdf
it would appear as now.
Does this sound like a reasonable facility?
Cheers
Deri
- [Groff] gropdf finally added to groff, Werner LEMBERG, 2011/07/26
- Re: [Groff] gropdf finally added to groff, Deri James, 2011/07/28
- [Groff] gropdf and pdfroff,
Deri James <=
- Re: [Groff] gropdf and pdfroff, Ralph Corderoy, 2011/07/28
- Re: [Groff] gropdf and pdfroff, Deri James, 2011/07/28
- Re: [Groff] gropdf and pdfroff, Pierre-Jean, 2011/07/28
- Re: [Groff] gropdf and pdfroff, Anton, 2011/07/29
- Re: [Groff] gropdf and pdfroff, Ralph Corderoy, 2011/07/29
- Re: [Groff] gropdf and pdfroff, Anton Shepelev, 2011/07/29
- Re: [Groff] gropdf and pdfroff, Keith Marshall, 2011/07/30
- Re: [Groff] gropdf and pdfroff, Werner LEMBERG, 2011/07/29
- Re: [Groff] gropdf and pdfroff, Mike Bianchi, 2011/07/29
- Re: [Groff] gropdf and pdfroff, Werner LEMBERG, 2011/07/29