0

Our invoicing system needs to print OMR (optical mark recognition) symbol on each page of our invoices so the folding machine knows what to put in the envelope.

That little PNG picture with OMR mark has to be put on each page. Our invoice is consisted of main report with two subreports created in special .jrxml files. Picture is generated by calling web service with passing page number and 'last page' mark as a parameter in http request.

What we can't put to right is that 'last page' mark since variable called $v{PAGE_NUMBER} can be read in two contextes: page and report. If you read it in page context you will have actual page number, in report context that variable will give you total number of pages. You cannot read such variable at once and know that you are on, lets say, page 3 of 5.

Since I have 'access' to last page (last page is filled with static text) in main report I can put another image with total number of pages and hardcode 'last page' parameter set to true, and put that image on the very same position on paper where regular image 'sits' so this image will overflow another generated in transactions subreport, but then there is no rule of which image will be over another, this approach is only partly successfull.

What can I do?

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
ante.sabo
  • 3,141
  • 6
  • 28
  • 36
  • Try to explain in simple words what the problem exactly is. Rewrite the last paragraph and better if you can attach a screenshot. – mohdajami Dec 29 '10 at 13:58
  • tried to make things more clear, anyway, I've given up on this issue and made one more pass over PDF document with iText's PdfStamper, put 'stamps' where needed so it works just as it should, only maybe little slower.. – ante.sabo Jan 04 '11 at 12:36

1 Answers1

0

If you put the OMR symbol in the footer, you can use the report element Last Page Footer, which will cause the last page footer to be different than the other page footers in the report. This way you can put a last page mark on the last page of the report.

Sean
  • 971
  • 4
  • 12
  • 21
  • ...yes, but what I need is picture on left margin, upper left corner of paper, 4 cm from top of paper. Even so, it is feasible to put picture there, although picture would be 'registered' with page footer (tried so), but it is hard to put pic on desired position precisely, and then I have problem with overflowing picture with another.. – ante.sabo Jan 13 '11 at 08:05