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 Neil Guinto <ng...@mincron.com> on 2005/07/14 17:49:56 UTC

Document off by a line

I have these situation where I'm printing a report using FOP 
(AwtRenderer).  It is being sent thru a dot matrix printer using a 
pre-printed form.  The problem we noticed is that when doing multi-pages 
print at some point the document shifts down a line.  Normally it 
happens after 15 pages of printout or so.  As I analyse the situation to 
me it looks like that the spaces between lines are being padded with an 
"X" miniscule amount, eventually it gets accumulated enough that the 
document is now off by a line.  I hate the thought of doing hundreds of 
pages and now it will off by "X" amount of line.

Has anyone had a similar problem?  Any guidance/advise is much appreciated.

Environment:
java version "1.4.2_08"
fop version "0.20.5"


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


Re: Document off by a line

Posted by Neil Guinto <ng...@mincron.com>.
I finally found the reason for the problem.  Completely unrelated to 
FOP, after much pulling of hair.  The line creep that I'm experiencing 
is cause by our printer (Oki).  A different printer (Lexmark) that I 
tested with don't have the creeping problem.  Appreciate all the posted 
advise.


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


Re: Document off by a line

Posted by Neil Guinto <ng...@mincron.com>.
> So, you're actually using one page-sequence for each page? A bit 
> puzzling, since I'd expect no mysterious carry-over of excess space 
> between page-sequences...
> Do you know if this is AWTRenderer specific? (Have you tried rendering 
> the same document to PDF or PostScript to see if something similar 
> occurs?)

I'm aftraid that it might be the AWTRenderer, since we use the 
PDFRenderer for dynamic viewing and there is no problem.

>
> BTW: did you notice that the line-height for your document is smaller 
> than the font-size? Don't know if this could be causing strange 
> behaviour...

Sorry that's a typo it should read line-height="11pt" font-size="12pt"

>
> Anyway, what I was hinting at was keeping the whole lot in one 
> page-sequence, but adding an explicit 'break-after="page"' to what you 
> know will be the last line of the page.
>
At this point I rather stick to what we already have and use 
fo:page-sequence as a page separator.

> Of course, this will only work if the page-masters are the same for 
> all pages...
>
Yes they all use the same fo:simple-page-master


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


Re: Document off by a line

Posted by "Andreas L.Delmelle" <a_...@pandora.be>.
On Jul 14, 2005, at 20:42, Neil Guinto wrote:

>
>>
>> So, when you use pre-printed forms, do you mean that the multi-page 
>> documents are actually collections of forms (different pages but all 
>> the same layout)?
>>
> Exactly.
>
>> If the form itself is only one or two pages, you may be able to avoid 
>> the problem by working with explicit breaks (break-before / 
>> break-after), instead of letting the formatter take care of the 
>> implicit page-breaks.
>
> Could you elaborate? To give further info, in our case a single line 
> translates to a fo:block
>
> Here is a condensed version of our source... It repeats several times. 
> fo:page-sequence signifies page separation.

So, you're actually using one page-sequence for each page? A bit 
puzzling, since I'd expect no mysterious carry-over of excess space 
between page-sequences...
Do you know if this is AWTRenderer specific? (Have you tried rendering 
the same document to PDF or PostScript to see if something similar 
occurs?)

BTW: did you notice that the line-height for your document is smaller 
than the font-size? Don't know if this could be causing strange 
behaviour...

Anyway, what I was hinting at was keeping the whole lot in one 
page-sequence, but adding an explicit 'break-after="page"' to what you 
know will be the last line of the page.

<fo:page-sequence line-height="8pt" font-size="12pt"
                   font-family="Courier" master-reference="First-Page">
   <fo:flow flow-name="xsl-region-body">
     <fo:block ...>Line 1</fo:block>
     <!-- continued until last block on the page -->
     <fo:block break-after="page">Last Line</fo:block>

     <fo:block ...>Line 1</fo:block>
     <!-- continued ... -->
     <fo:block break-after="page">Last Line</fo:block>
   </fo:flow>
</fo:page-sequence>

Of course, this will only work if the page-masters are the same for all 
pages...

Greetz,

Andreas


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


Re: Document off by a line

Posted by Mike Trotman <mi...@datalucid.com>.
Can you try separating each line with an empty <fo:block/> (rather than 
enclosing each line)
and see if you get the same cumulative effect?
(I.e. - treat <fo:block/> as the newline command.)

And - do you have any lines that 'exactly' fill the width of the page 
(so FOP may be generating a line break for empty content?)

There is a bug with line spacing in FOP that I have encountered with 
page-breaks and  text after tables - where FOP seems to calculate some 
extra padding of almost the same height as the text
and so breaks to the new page too early.
So - there may be a subtle bug in the vertical spacing calculations 
somewhere that generates an extra line.

Mike

Neil Guinto wrote:

>
>>
>> So, when you use pre-printed forms, do you mean that the multi-page 
>> documents are actually collections of forms (different pages but all 
>> the same layout)?
>>
> Exactly.
>
>> If the form itself is only one or two pages, you may be able to avoid 
>> the problem by working with explicit breaks (break-before / 
>> break-after), instead of letting the formatter take care of the 
>> implicit page-breaks.
>
>
> Could you elaborate? To give further info, in our case a single line 
> translates to a fo:block
>
> Here is a condensed version of our source... It repeats several times. 
> fo:page-sequence signifies page separation.
>
> <fo:page-sequence line-height="8pt" font-size="12pt" 
> font-family="Courier" master-reference="First-Page">
> <fo:flow flow-name="xsl-region-body">
> <fo:block start-indent="0.00pt" space-after.optimum="0.00pt" 
> space-before.optimum="0.00pt">Line 1 (Actual text edited)</fo:block>
> <fo:block start-indent="0.00pt" space-after.optimum="0.00pt" 
> space-before.optimum="0.00pt">Line 2 </fo:block>
> </fo:flow>
> </fo:page-sequence>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>

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


Re: Document off by a line

Posted by Neil Guinto <ng...@mincron.com>.
>
> So, when you use pre-printed forms, do you mean that the multi-page 
> documents are actually collections of forms (different pages but all 
> the same layout)?
>
Exactly.

> If the form itself is only one or two pages, you may be able to avoid 
> the problem by working with explicit breaks (break-before / 
> break-after), instead of letting the formatter take care of the 
> implicit page-breaks.

Could you elaborate? To give further info, in our case a single line 
translates to a fo:block

Here is a condensed version of our source... It repeats several times. 
fo:page-sequence signifies page separation.

<fo:page-sequence line-height="8pt" font-size="12pt" 
font-family="Courier" master-reference="First-Page">
<fo:flow flow-name="xsl-region-body">
<fo:block start-indent="0.00pt" space-after.optimum="0.00pt" 
space-before.optimum="0.00pt">Line 1 (Actual text edited)</fo:block>
<fo:block start-indent="0.00pt" space-after.optimum="0.00pt" 
space-before.optimum="0.00pt">Line 2 </fo:block>
</fo:flow>
</fo:page-sequence>



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


Re: Document off by a line

Posted by "Andreas L.Delmelle" <a_...@pandora.be>.
On Jul 14, 2005, at 17:49, Neil Guinto wrote:

Hi,

> I have these situation where I'm printing a report using FOP 
> (AwtRenderer).  It is being sent thru a dot matrix printer using a 
> pre-printed form.  The problem we noticed is that when doing 
> multi-pages print at some point the document shifts down a line.  
> Normally it happens after 15 pages of printout or so.  As I analyse 
> the situation to me it looks like that the spaces between lines are 
> being padded with an "X" miniscule amount, eventually it gets 
> accumulated enough that the document is now off by a line.  I hate the 
> thought of doing hundreds of pages and now it will off by "X" amount 
> of line.

So, when you use pre-printed forms, do you mean that the multi-page 
documents are actually collections of forms (different pages but all 
the same layout)?

If the form itself is only one or two pages, you may be able to avoid 
the problem by working with explicit breaks (break-before / 
break-after), instead of letting the formatter take care of the 
implicit page-breaks.
Well, at least the mentioned accumulation of excess space won't get 
noticed, since it happens only within the one or two pages spanned by 
the form...


HTH!

Greetz,

Andreas


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