You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Rob Stote <RS...@whitehilltech.com> on 2003/05/13 16:52:19 UTC

OMR Fold Marks Looking for Help

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. 

Sorry for the long windedness of the email

Rob

Re: OMR Fold Marks Looking for Help

Posted by Jeremias Maerki <de...@greenmail.ch>.
I wrote a DSC parser (DSC = Document Structuring Conventions, See
http://partners.adobe.com/asn/tech/ps/technotes.jsp) to find the right
places in the PostScript files. And to anticipate your next question:
Unfortunately, I don't have access to that code anymore.

On 13.05.2003 18:31:59 Rob Stote wrote:
> 	Thank you for the point in the right direction. I was planning on
> doing that if all else failed, and I think I will probably go with rendering
> to PS, and inserting the marks afterward. I do have a question for you, and
> we can take this offline if you want.... What did you use to do the insert,
> or did you write your own tool ?


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: OMR Fold Marks Looking for Help

Posted by Jeremias Maerki <de...@greenmail.ch>.
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: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org