Thanks for your response, Joerg.  Read on if you think you might be able to
help me further.

> -----Original Message-----
> From: Joerg Pietschmann [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 29, 2002 10:04 AM
> To: FOP User
> Subject: Re: multiple output files
>
>
> "Matthew L. Avizinis" <[EMAIL PROTECTED]> wrote:
> >   A whole lotta help needed please:  I need to write to a file
> all the 1)
> > page-number-citations page numbers along with their
> corresponding ref-id's
> > also the 2) last page of the pdf file being currently generated
> by FOP along
> > with it's corresponding file name.
>
> Odd subject for these questions. However, look at
>   http://marc.theaimsgroup.com/?l=fop-dev&m=100747811203665&w=2
> and decide whether this helps you. In any case, i can't see
Well, yes and no.  It does show how I might pull some other information out
and maybe write it out to a new file.  However, what I need more is the
_last page number_.  What method actually generates the actual page number
for <fo:page-number>?  Knowing that, even if I can't determine the last one,
I could write output of all page-numbers to an xml file in addition to the
pdf and then later just find the last one generated.

> how you can achieve your goal without fiddling with FOP internals.
> You might also want to educate yourself about how to write FOP
> extension functions. There is a brief intro in
>  docs/html-docs/extensions.html
> in your FOP distribution.
Judging by the (rather sparse) instructions, it seems to me that what I need
is not an extension to fo but a way to grab information fop is already
producing and spit it out to an xml file as it's generated, while at the
same time allowing the pdf to continue to be output.  So, yes it looks like
I have to fiddle with the FOP internals, but the question is, "Where is a
logical location to begin?"  There's a lot of code and I'm not that really
familiar with the itnernals of the project yet.
At first glance, it looks like I could stick in a few lines of code in the
PageNumberCitation Status method to write out the information I need to a
new file (or append to an existing file).  As to the getting the last page,
it seems I would need to get the current PageNumber from someplace and write
it out.
I know that somewhere I will have to put some basic code like
try
   {
    BufferedWriter out = new BufferedWriter(new
FileWriter("filename",true));
    out.write("the formatted information I want");
    out.close();
} catch (IOException e) {
}
to append to my temporary information file with this format

<info>
   <x-ref id="###">pg#</x-ref>
   <x-ref id="###">pg#</x-ref>
   <x-ref id="###">pg#</x-ref>
   <file name="goo.pdf">last-page#</file> (or just a list of all page
numbers in this pdf)
    ....
    ....
   <x-ref id="###">pg#</x-ref>
   <x-ref id="###">pg#</x-ref>
   <x-ref id="###">pg#</x-ref>
   <file name="goo.pdf">last-page#</file>
</info>


>
> HTH
> J.Pietschmann

Reply via email to