Re: More on external graphics

2011-12-16 Thread Pascal Sancho
Hi Luis,
I tried your initial FO (with negative margin) against FOP 1.0 and FOP
trunk:
FOP 1.0 is buggy while FOP trunk works as expected.

In addition, note that with fo:external-object or
fo:instream-foreign-object, there are half-leading before and after,
that depend on font-size and line-height.
So, if your fo:block contains no text, you can set its font-height to 0.

If line-height has a ration value (witch is inherited and defaults to
1.2), you do not need to explicitely set it to 0

Le 16/12/2011 00:50, Luis Bernardo a écrit :
 On 12/15/11 7:44 PM, Samuel Penn wrote:
 On Thursday 15 December 2011 00:26:43 Luis Bernardo wrote:
 Your page definitions (margins, paddings, and so on) may be part of the
 problem. Negative margins in a page are suspicious to me...
 I probably had a reason for that, but I did that 10 years ago, so I
 don't remember why.
 Maybe to get around a bug... but you should not need to do so now. But 
 it is important to understand the page regions and how margins relate to 
 extents.
 I fixed your example by reducing it a simpler case. If you are not using
 using the start, end, before and after regions you do not need to define
 them. Probably later you will want to use them for static content but
 for the purposes of your example they are not needed.
 I do need all those regions in the real document. I've added your
 margins into my actual stylesheet, and the graphics are fixed, however
 the page dimensions are now too squashed.

 For some reason, if I tweak the margins a bit, then the image problem
 comes back. I did remove the negative margins whilst testing the
 example I sent, and it made no difference, so it seems not to be -ve
 margins as such, but it is something to do with those margins.
 Attached is an example with the side regions in place. The output is the 
 same as before.
 At least this gives me something to play with, and I can try tweaking
 the values (and refresh my memory of what they all mean) to try and
 find out exactly what values cause the issue.

 Thanks very much for your help.

 

-- 
Pascal

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



Re: More on external graphics

2011-12-16 Thread Pascal Sancho
Sorry, this was addressed to Samuel

Le 16/12/2011 09:50, Pascal Sancho a écrit :
 Hi Luis,

-- 
Pascal

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



Re: More on external graphics

2011-12-16 Thread Samuel Penn
On Thursday 15 December 2011 23:50:54 Luis Bernardo wrote:
 On 12/15/11 7:44 PM, Samuel Penn wrote:
  For some reason, if I tweak the margins a bit, then the image problem
  comes back. I did remove the negative margins whilst testing the
  example I sent, and it made no difference, so it seems not to be -ve
  margins as such, but it is something to do with those margins.
 
 Attached is an example with the side regions in place. The output is the
 same as before.

Thanks. I actually just took the margins you defined and inserted them
into my stylesheets, and it all worked. I almost have things how I want
them, I just need to do some print tests to make sure it looks okay.

However, it seems to be that if the left/right page margins don't match, 
then I get the problem with misplaced images. e.g., if I take 1mm off the
left margin on right hand pages, I need to also take 1mm off the right
margin on left hand pages in order for images to be placed correctly.

Not sure if this is expected behaviour, but it seems like a bug.

-- 
Be seeing you,Games: http://www.glendale.org.uk/
Sam.  Posts: http://www.google.com/profiles/samuel.penn

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



Re: More on external graphics

2011-12-16 Thread Pascal Sancho
Hi Samuel,

I don't understand what you mean by if I take 1mm off the left margin
on right hand pages...
Can you provide a short snippet to illustrate, please?

I know there is a bug in inline-progression-dimension computation when
using 'mm' or 'cm' as unit, that can cause trouble when using inverted
left/right margins, witch is the case with your XSL-FO (see [1]).

[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=51043

Le 16/12/2011 10:13, Samuel Penn a écrit :
 On Thursday 15 December 2011 23:50:54 Luis Bernardo wrote:
 On 12/15/11 7:44 PM, Samuel Penn wrote:
 For some reason, if I tweak the margins a bit, then the image problem
 comes back. I did remove the negative margins whilst testing the
 example I sent, and it made no difference, so it seems not to be -ve
 margins as such, but it is something to do with those margins.

 Attached is an example with the side regions in place. The output is the
 same as before.
 
 Thanks. I actually just took the margins you defined and inserted them
 into my stylesheets, and it all worked. I almost have things how I want
 them, I just need to do some print tests to make sure it looks okay.
 
 However, it seems to be that if the left/right page margins don't match, 
 then I get the problem with misplaced images. e.g., if I take 1mm off the
 left margin on right hand pages, I need to also take 1mm off the right
 margin on left hand pages in order for images to be placed correctly.
 
 Not sure if this is expected behaviour, but it seems like a bug.
 


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



Re: More on external graphics

2011-12-16 Thread Vincent Hennebert
Hi Samuel,

You have already figured out how to avoid the problem, but FYI, what you
are witnessing is the result of a bug in the code that handles pages of
different widths (the infamous Changing IPD feature). That bug appears
to have been fixed in Trunk but I don’t remember when.

Unless you have a good reason for wanting pages of different widths
I advise you to make sure that the widths of the region-body on all your
pages match. That is, make sure that the following operation:
  page-width
  − margin-left and margin-right on the simple-page-master
  − margin-left and margin-right on the region-body
gives the same result for all your pages.

HTH,
Vincent


On 16/12/11 10:53, Samuel Penn wrote:
 On Friday 16 December 2011 10:17:32 Pascal Sancho wrote:
 Hi Samuel,

 I don't understand what you mean by if I take 1mm off the left margin
 on right hand pages...
 Can you provide a short snippet to illustrate, please?
 
 Take the following definitions for left and right pages (these can be
 plugged into the test.fo that Luis posted):
 
 fo:simple-page-master master-name=leftPage page-height=297mm page-
 width=210mm margin-top=15mm margin-bottom=15mm margin-left=15mm 
 margin-right=30mm
 fo:region-body margin-left=20mm margin-right=21mm/
 fo:region-before extent=15mm region-name=region-before-left/
 fo:region-after extent=10mm region-name=region-after-left/
 fo:region-start extent=20mm/
 fo:region-end extent=10mm/
 /fo:simple-page-master
 
 fo:simple-page-master master-name=rightPage page-height=297mm page-
 width=210mm margin-top=15mm margin-bottom=15mm margin-left=30mm 
 margin-right=15mm
 fo:region-body margin-left=21mm margin-right=20mm/
 fo:region-before extent=16mm region-name=region-before-right/
 fo:region-after extent=10mm region-name=region-after-right/
 fo:region-start extent=20mm/
 fo:region-end extent=10mm/
 /fo:simple-page-master
 
 
 Both are balanced, in that the margin-right/margin-left for both
 the simple-page-master and region-body mirror each other for the
 left and right pages. In this case, images are placed correctly.
 
 Concentrating on the following lines:
 
 left:  fo:region-body margin-left=20mm margin-right=21mm/
 right: fo:region-body margin-left=21mm margin-right=20mm/
 
 
 If I change the margin-right for the left page to be 22mm, then the
 images are incorrectly placed on 2nd and subsequent pages (the problem
 that I was seeing).
 
 If I also update the margin-left for the right page to be 22mm
 however, then images are correctly placed again.
 
 There seems to be a similar constraint for the simple-page-master
 margins, in that left page needs to mirror right page. Changing
 the margins on one page (but not the other) breaks the images again.
 
 
 Am I making sense?
 

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



Re: More on external graphics

2011-12-15 Thread Samuel Penn
On Thursday 15 December 2011 00:26:43 Luis Bernardo wrote:
 Your page definitions (margins, paddings, and so on) may be part of the
 problem. Negative margins in a page are suspicious to me...

I probably had a reason for that, but I did that 10 years ago, so I
don't remember why.

 I fixed your example by reducing it a simpler case. If you are not using
 using the start, end, before and after regions you do not need to define
 them. Probably later you will want to use them for static content but
 for the purposes of your example they are not needed.

I do need all those regions in the real document. I've added your
margins into my actual stylesheet, and the graphics are fixed, however
the page dimensions are now too squashed.

For some reason, if I tweak the margins a bit, then the image problem
comes back. I did remove the negative margins whilst testing the
example I sent, and it made no difference, so it seems not to be -ve
margins as such, but it is something to do with those margins.

At least this gives me something to play with, and I can try tweaking
the values (and refresh my memory of what they all mean) to try and
find out exactly what values cause the issue.

Thanks very much for your help.

-- 
Be seeing you,Games: http://www.glendale.org.uk/
Sam.  Posts: http://www.google.com/profiles/samuel.penn

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



Re: More on external graphics

2011-12-15 Thread Luis Bernardo

On 12/15/11 7:44 PM, Samuel Penn wrote:

On Thursday 15 December 2011 00:26:43 Luis Bernardo wrote:

Your page definitions (margins, paddings, and so on) may be part of the
problem. Negative margins in a page are suspicious to me...

I probably had a reason for that, but I did that 10 years ago, so I
don't remember why.
Maybe to get around a bug... but you should not need to do so now. But 
it is important to understand the page regions and how margins relate to 
extents.

I fixed your example by reducing it a simpler case. If you are not using
using the start, end, before and after regions you do not need to define
them. Probably later you will want to use them for static content but
for the purposes of your example they are not needed.

I do need all those regions in the real document. I've added your
margins into my actual stylesheet, and the graphics are fixed, however
the page dimensions are now too squashed.

For some reason, if I tweak the margins a bit, then the image problem
comes back. I did remove the negative margins whilst testing the
example I sent, and it made no difference, so it seems not to be -ve
margins as such, but it is something to do with those margins.
Attached is an example with the side regions in place. The output is the 
same as before.

At least this gives me something to play with, and I can try tweaking
the values (and refresh my memory of what they all mean) to try and
find out exactly what values cause the issue.

Thanks very much for your help.



?xml version=1.0?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:yb=http://yagsbook.sourceforge.net/xml;

fo:layout-master-set

fo:simple-page-master master-name=leftPage page-height=297mm page-width=210mm margin-top=10mm margin-bottom=10mm margin-left=10mm margin-right=10mm
fo:region-body margin-left=5mm margin-right=20mm margin-top=5mm margin-bottom=5mm /
fo:region-before extent=5mm /
fo:region-after extent=5mm /
fo:region-start extent=5mm /
fo:region-end extent=20mm /
/fo:simple-page-master

fo:simple-page-master master-name=rightPage page-height=297mm page-width=210mm margin-top=10mm margin-bottom=10mm margin-left=10mm margin-right=10mm
fo:region-body margin-left=20mm margin-right=5mm margin-top=5mm margin-bottom=5mm /
fo:region-before extent=5mm /
fo:region-after extent=5mm /
fo:region-start extent=20mm /
fo:region-end extent=5mm /
/fo:simple-page-master

fo:page-sequence-master master-name=document
fo:repeatable-page-master-alternatives
fo:conditional-page-master-reference master-reference=leftPage odd-or-even=even/
fo:conditional-page-master-reference master-reference=rightPage odd-or-even=odd/
/fo:repeatable-page-master-alternatives
/fo:page-sequence-master

/fo:layout-master-set


fo:page-sequence master-reference=document
fo:flow flow-name=xsl-region-body text-align=justify

fo:block font-family=serif font-weight=bold font-size=20pt line-height=24pt space-after=12pt text-align=startMain Heading/fo:block

fo:block font-size=10pt font-family=serif line-height=12pt space-after=10pt
Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Nam erat magna, vulputate nec rhoncus at,
tristique id urna. Etiam orci nulla, lobortis ac
elementum quis, venenatis vel elit. Aenean eros
ante, facilisis quis semper eget, vulputate id
arcu. Pellentesque at leo arcu, non hendrerit
nibh. Aenean fringilla commodo nulla, sit amet
feugiat urna molestie nec. Duis dui augue,
pulvinar non sodales et, vehicula ut justo. Donec
cursus pretium lacus nec faucibus. Donec tempus
arcu nec libero auctor consequat. Cum sociis
natoque penatibus et magnis dis parturient montes,
nascetur ridiculus mus. Donec non nunc in dolor
pharetra lacinia. Duis sodales mattis turpis in
malesuada. Integer placerat porta sagittis.
Integer sapien magna, aliquet id commodo in,
ullamcorper rhoncus nibh. Cras a nulla lacus,
quis blandit nulla.
/fo:block

fo:block font-size=10pt font-family=serif line-height=12pt space-after=10pt
Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Nam erat magna, vulputate nec rhoncus at,
tristique id urna. Etiam orci nulla, lobortis ac
elementum quis, venenatis vel elit. Aenean eros
ante, facilisis quis semper eget, vulputate id
arcu. Pellentesque at leo arcu, non hendrerit
nibh. Aenean fringilla commodo nulla, sit amet
feugiat urna molestie nec. Duis dui augue,
pulvinar non sodales et, vehicula ut justo. Donec
cursus pretium lacus nec faucibus. Donec tempus
arcu nec libero auctor consequat. Cum sociis