[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Graphics scaling on XSLFO - need suggestions

Subject: RE: Graphics scaling on XSLFO - need suggestions
From: "Angela Williams" <Angela.Williams@xxxxxxxxxxxxxxxxxx>
Date: Mon, 12 Feb 2007 12:49:43 -0600
RE:  Graphics scaling on XSLFO - need suggestions
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({@href})"/>

-----Original Message-----
From: ms [mailto:mina_hurray@xxxxxxxxx]
Sent: Friday, February 09, 2007 1:20 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  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="{@height}"
content-width="{@width}" src="url({@href})"/>

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

--- Angela Williams
<Angela.Williams@xxxxxxxxxxxxxxxxxx> wrote:

> I use XEP 4.4 and scale the content-height
> successfully.
>
> -----Original Message-----
> From: ms [mailto:mina_hurray@xxxxxxxxx]
> Sent: Friday, February 09, 2007 10:57 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  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@xxxxxxxxxxxx> 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
> >
> >
>
>
>
>
>
________________________________________________________________________
> ____________
> 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
>
>




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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.