I did this without FOP extension. Basically, I patched the generated
PostScript files with the code for painting the OMR marks. Worked very
well.

If you want to try with an extension you will have to find a way to stop
FOP from writing pages to the target file before not all the pages have
been rendered (because you said you need to know the total number of
pages, right? Well, I wonder what kind of OMR marks you need because I
didn't have to know about the total number of pages). Now, if you have
hundreds or thousand of pages in one run, you'll get into memory trouble.
Patching the PostScript file spares you that part. 

If you're working with PDF you can also easily patch each page using a
PDF postprocessor.

If you need to know document boundaries you can use a page-sequence for
each subdocument and then evaluate Driver.getResults() to get the page
count for each page-sequence.

Good luck!

On 13.05.2003 16:52:19 Rob Stote wrote:
> 
> Hello all:
>       I have been madly reviewing both the XSL-FO and FOP boards for an
> answer to the following question:
>       How do I determine the amount of pages, in a document and the
> current page I am on. I think I may have to write an extension to determine
> this. Here is why I need this information:
>       I am dealing with creating a document which is to be fed into a
> machine which utilizes optical mark recognition (OMR) technology. Basically
> it looks like a bar code in the top right hand corner of the page, this "bar
> code", or series of hash marks is different for every page in the document
> and appears on each page. The document is fed into the machine, and based on
> these "lines" the machine knows how many pages to grab and fold. 
>       Now that we know the problem, the kicker is: The bar codes change
> depending on how many pages are in the document. For example: If I have a 5
> page document, it will have "blah" set of bar codes for each page. Every
> five page document shares the same "blah" bar codes. But a 5 page document's
> bar codes are completely different from a document which is 7 pages long.
> This is why I need to know how may pages are in the document I am rendering.
> If I have that I can dynamically assign the appropriate "region-before" to
> the document.
>       Has someone come across this before, and how did you solve it (Oleg
> I know you posted something about this, a while back and Ken answered your
> question, but you situation I think was slightly different)? If no-on has,
> the only way I can see for doing this is to create an extension into FOP
> which can some how extend inserting an external graphic, while utilizing the
> functionality of page-number-citation. I began looking through
> PageNumberCitation.java and was confused by some stuff I found. Either way,
> I was wondering is there somewhere a real good document on how to create an
> extension. I have examined the SVG, and the mathML extensions, and am still
> a little lost. 


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to