xsl-list
[Top] [All Lists]

RE: [xsl] Graphics scaling on XSLFO - need suggestions

2007-02-12 11:50:09
No - your code doesn't work for me, either.  

See http://www.renderx.net/lists/xep-support/2089.html for more info on
scaling graphics.

If your page margins are defined as 8.5 x 11, I believe you need to
subtract the top and bottom page margin AND the top and bottom body
margin to determine the allowable height of the graphic (likewise, the
left and right page and body margins to determine the max width.) 

In my case, I am using .5in margins for both page and body (1in total
all around), so the I believe the max allowable height of the graphic
would be 9in for an 11in page-height BUT the max width would only be
6.5in.

I set the height and width to equal the max values and used
scale-to-fit. 

<xsl:attribute-set name="first-page-body-margins">
A)    <xsl:attribute name="margin-top">.5in</xsl:attribute>
B)    <xsl:attribute name="margin-bottom">.5in</xsl:attribute>
C)    <xsl:attribute name="margin-left">.5in</xsl:attribute>
D)    <xsl:attribute name="margin-right">.5in</xsl:attribute>
  </xsl:attribute-set>
  
  <xsl:attribute-set name="first-page-margins">
E)    <xsl:attribute name="page-height">11in</xsl:attribute>
F)    <xsl:attribute name="page-width">8.5in</xsl:attribute>
G)    <xsl:attribute name="margin-top">.5in</xsl:attribute>
H)    <xsl:attribute name="margin-bottom">.5in</xsl:attribute>
I)    <xsl:attribute name="margin-left">.5in</xsl:attribute>
J)    <xsl:attribute name="margin-right">.5in</xsl:attribute>
  </xsl:attribute-set>


E - A - B - G - H = 9in max height
F - C - D - I - J = 6.5 max width

<fo:external-graphic content-height="scale-to-fit" height="9in"
content-width="scale-to-fit" width="6.5in" src="url({(_at_)href})"/>

-----Original Message-----
From: ms [mailto:mina_hurray(_at_)yahoo(_dot_)com] 
Sent: Friday, February 09, 2007 1:20 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Graphics scaling on XSLFO - need suggestions

Hi Angela:

I use XEP 4.4 too. The xml for the graphics has:

<graphic href="2367.tif" height="8.35in"
width="7.5in"/>

And in the XSLFO i use <fo:external-graphic>

My code has 

<fo:external-graphic content-height="{(_at_)height}"
content-width="{(_at_)width}" src="url({(_at_)href})"/>

Please let me know if there is anything wrong in this
construct. 

--- Angela Williams
<Angela(_dot_)Williams(_at_)the401kcompany(_dot_)com> wrote:

I use XEP 4.4 and scale the content-height
successfully.

-----Original Message-----
From: ms [mailto:mina_hurray(_at_)yahoo(_dot_)com] 
Sent: Friday, February 09, 2007 10:57 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Graphics scaling on XSLFO - need
suggestions

Hello all:

Thank you for your reply. I use XEP. And I did try
setting just the content-width and still get the
same
error.I will check the XEP forum.


--- Jay Bryant <jay(_at_)bryantcs(_dot_)com> wrote:

Hi all:

I am having issues with displaying graphics on
the
PDF
using XSLFO. A graphic measuring 7.5in by 8.35in
gives
a "no space for element to recover" error while
generating the PDF using XSLFO. Can anybody
point
me
to a forum where I can post these kind of issues
or
can anyone on this list give me some ideas?

Thanks in advance

Hi, Mina,

It would help if you would mention which FO
processor you use, because the 
answer to your problem probably varies by
processor.
However, you can try a 
couple things that may work regardless of which
processor you use. (Also, I 
assume that you are using the external-graphic
element.)

First, try setting the content-width attribute to
whatever width you want. 
The height should scale automatically. You can
also
try setting the width 
attribute (though that's really for the bounding
box
around the image).

This is the right place for FO questions, by the
way. However, whatever 
processor you use very probably has a mailing list
or forum where folks who 
know the quirks of that tool can provide more
specific answers.

HTH

Jay Bryant
Bryant Communication Services 





--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:

<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





 

________________________________________________________________________
____________
Don't get soaked.  Take a quick peak at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather


--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





 
________________________________________________________________________
____________
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--