Next in thread → Next in month →

Re: [docbook-apps] rotate figures with a pi

From
Bob Stayton <>
Date
2011-11-02T19:00:36+00:00
ID
002101cc9991$a6e78480$6600a8c0@pazu
Thread
Re: [docbook-apps] rotate figures with a pi
Hi Benno,

I think this is an issue with FOP.  The output 
looks correct when processed with RenderX's XEP and Antenna House XSL 
Formatter.

 

I'm still not quite clear on what you mean when you 
say that "some of the attributes are not reached through".  Exactly which 
attributes and where did you expect them to appear?  You mentioned 
start-indent, but I would not have expected the start-indent="0" from 
pgwide="1" to be put on your fo:block-container since that is a customization 
you added.  Your customization needs to add any properties it needs.  
Nothing inherits outward, only inward in the hierarchy.  

 

I don't see any other attributes that are not 
properly passed though.  In your original 
mail, you highlighted the content-width="scale-to-fit" property in your FO 
output, but that actually is being output by the stylesheet.

 

You might try using the free version of XEP to see 
if produces the results you want, and then raise the issue with the FOP group if 
it cannot duplicate that result.

  

Bob Stayton
Sagehill Enterprises


 

 

  
----- Original Message ----- 

  
From: 
  Benno Wolf 

  
To: Bob Stayton 

  
Sent: Wednesday, November 02, 2011 9:13 
  AM

  
Subject: Re: [docbook-apps] rotate 
  figures with a pi

  

Hi,
thanks for the replies, unfortunately Dean Nelsons 
  solution did not work either.
So here is what I use and get out of 
  it:

Input.xml:

  <figure 
    pgwide="1">
            
    <?landscapeFigure?>
            
    <title>Message 
    Flow</title>
            
    <mediaobject>
               
    <imageobject>
                  
    <imagedata fileref="Pictures/MessageFlow.png" width="100%" 
    contentdepth="100%" 
    scalefit="1"/>
               
    </imageobject>
            
    </mediaobject> 
  </figure>

Customization.xsl:

  <xsl:template 
    match="d:figure[processing-instruction('landscapeFigure')]">
    
        <fo:block-container 
    
            
    reference-orientation="90"
        
        start-indent="0"
        
        width="100%"
        
        height="auto">
    
        <xsl:apply-imports/>
    
        </fo:block-container> 
  </xsl:template>

Input.fo:

  <fo:block-container reference-orientation="90" 
    start-indent="0" width="100%" 
    height="auto">
                
    <fo:block 
    start-indent="0pt">
                    
    <fo:block space-before.minimum="0.5em" space-before.optimum="1em" 
    space-before.maximum="2em"
                        
    space-after.minimum="0.5em" space-after.optimum="1em" 
    space-after.maximum="2em" keep-together.within-column="auto" 
    id="d0e172">
                        
    <fo:block
                            
    space-before.optimum="1em" space-before.minimum="0.8em" 
    space-before.maximum="1.2em" font-weight="bold" 
    font-size="12pt"
                            
    hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em" 
    space-after.maximum="0.8em" 
    font-family="inherit"
                            
    keep-with-next.within-column="always">
                            
    Figure 2. Message 
    Flow
                        
    </fo:block>
                        
    <fo:block 
    id="d0e179">
                            
    <fo:external-graphic src="" width="100%" 
    height="auto" 
    content-width="scale-to-fit"
                                
    content-height="100%"/>
                        
    </fo:block>
                    
    </fo:block>
                
    </fo:block>
</fo:block-container>

  

As I said, the problem is that some of the attributes are not 
  reached through, which is why I had to put the fo-attribute

  start-indent="0"

in my customized 
  template to make sure the fo:block-container gets this information as well 
  (one can see that the original fo:block still has it, but it has no effect 
  since fo:block-container is wrapped around).

Somehow, these attributes 
  have no effect, at least not with my setup, which is:

DocBook XSL 
  1.75.2
Saxon 6.5.5
FOP 1.0

Don't know if it is important, but I 
  use
oXygen 11.2
to process the docs.

Since technical 
  documentation tend to have more big pictures like flow charts, toolchains and 
  such, I think it would make sense to put in a landscape attribute, like the 
  one for tables, for pictures as well.

Anyway, many thanks for any 
  help.

Regards,
Benno

 

  
2011/11/1 Bob Stayton <>

  
    

    
Hi Benno,

    
Not sure what is going on here.

    
Can you show exactly what the <figure> 
    element with its <imagedata> element looks like (including all input 
    attributes), as well as the fo output that you are getting that is not 
    correct?  Also, what version of the stylesheets are you using?  
    Thanks.

    
 

    
Bob Stayton
Sagehill Enterprises


    

    

    
 

    
 

    
      
----- Original Message ----- 

      
From: Benno Wolf 
      

      
To:  

      
Sent: Thursday, October 27, 2011 1:45 
      AM

      
Subject: [docbook-apps] rotate 
      figures with a pi

      

Hi,
I have a couple of big pictures which would fit 
      nicely on a a4-page in landscape - orientation. To do so, I used a 
      processing instruction as described in Mr. Stayton's book here. The problem seems that some attributes given to 
      <figure> and <imageobject> does not have an effect to the 
      rendered PDF. I even managed to replace the attribute to figure, 
      pgwide="1", which seems to be ineffective because it's is going to the 
      <fo:block> but not to the <fo:block-container>. That was easy 
      since you just have to put the start-indent="0" attribute to this wrapper 
      in the customization layer like that:

      <xsl:template 
        match="d:figure[processing-instruction('landscapeFigure')]">
     
        <fo:block-container reference-orientation="90" start-indent="0" 
        width="100%" height="auto">
        
        <xsl:apply-imports/>
     
        </fo:block-container>
</xsl:template>

Problem 
      is now that the scalefit="1" - attribute to the <imagedata> - 
      element does not go through to the generated .fo so the picture is still 
      far to big. If the fo file would look like that:

       <fo:block-container 
        reference-orientation="90" start-indent="0" width="100%" 
        height="auto"><fo:block 
        start-indent="0pt">
 <fo:block 
        space-before.minimum="0.5em" space-before.optimum="1em" 
        space-before.maximum="2em" space-after.minimum="0.5em" 
        space-after.optimum="1em" space-after.maximum="2em" 
        keep-together.within-column="auto" id="d0e159">
 <fo:block 
        space-before.optimum="1em" space-before.minimum="0.8em" 
        space-before.maximum="1.2em" font-weight="bold" font-size="12pt" 
        hyphenate="false" space-after.minimum="0.4em" 
        space-after.optimum="0.6em" space-after.maximum="0.8em" 
        font-family="inherit" 
        keep-with-next.within-column="always">Description</fo:block>
 <fo:block 
        id="d0e166"><fo:external-graphic 
        src="" width="100%" height="auto" 
        content-width="scale-to-fit" 
        content-height="100%"/></fo:block></fo:block></fo:block></fo:block-container>

      

then the picture would fit on the page perfectly.
Is there a 
      possibility to reach the scale-to-fit - instruction through or give it in 
      the customization layer?

Any answer is 
      appreciated.

Regards,
Benno
Next in thread → Next in month →