Hmmm 
I think you are talking about how we do it
We process contents of web pages from the web pulling in data etc from
remote sites and putting them into a template, 

A small example here (imagedataservlet returns xml containing the width and
height in pixels of an image)

<xsl:template name="crop-scale-image">
                <xsl:param name="content-width"/>
                <xsl:param name="content-height"/>
                <xsl:param name="imgurl"/>

                <xsl:variable name="imginfourl">
        
<xsl:text>http://www.example.com/ImageDataServlet-1.0/ImageDataServlet?imgsr
c=</xsl:text>
                        <xsl:value-of select="$imgurl"/>
                </xsl:variable>
                <xsl:variable name="imginfo"
select="document($imginfourl)"/>
                <xsl:variable name="imgWidthmm"
select="$imginfo/imginfo/imgwidth div 3.779527559"/>
                <xsl:variable name="imgHeightmm"
select="$imginfo/imginfo/imgheight div 3.779527559"/>
                <xsl:variable name="xscale" select="$content-width div
$imgWidthmm"/>
                <xsl:variable name="yscale" select="$content-height div
$imgHeightmm"/>
                <xsl:variable name="scale">
                        <xsl:choose>
                                <xsl:when test="$xscale >= $yscale">
                                        <xsl:value-of select="$xscale"/>
                                </xsl:when>
                                <xsl:otherwise>
                                        <xsl:value-of select="$yscale"/>
                                </xsl:otherwise>
                        </xsl:choose>
                </xsl:variable>
                <xsl:choose>
                        <xsl:when test="$yscale > $xscale">
                                <fo:external-graphic
scaling-method="resample-any-method"
                                                height="{$content-height}mm"
                                                width="{$content-width}mm"
                                                src="{$imgurl}"
                                                content-x="0mm"
                                                content-y="0mm"
                                                content-width="{$imgWidthmm
* $scale}mm"
        
content-height="{$imgHeightmm * $scale}mm"
                                                clip="auto"
                                                movie="auto"
                                />
                        </xsl:when>
                        <xsl:otherwise >
                                <fo:external-graphic
scaling-method="resample-any-method"
                                                height="{$content-height}mm"
                                                width="{$content-width}mm"
                                                src="{$imgurl}"
                                                content-x="0mm"
                                                content-y="0mm"
                                                content-width="{$imgWidthmm
* $scale}mm"
        
content-height="{$imgHeightmm * $scale}mm"
                                                clip="auto"
                                                movie="auto"
                                />
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template> 

Kindest regards


Theresa Forster
Senior Software Developer 

-----Original Message-----
From: Robyp1 [mailto:rob...@hotmail.com] 
Sent: 17 May 2011 08:57
To: fop-users@xmlgraphics.apache.org
Subject: problem resolve external image resource with fop


hi,

i have a problem using a fop in a web application. First of all,  this is
not only only a kind a web application but a maven web application with
others dependencies like libs or maven module (not web) linked. One kind of
this lib/maven module keep the source with embed a fop code for translate
xml into pdf using an xsl stylesheet. My problem is that the user request is
processed by a servlet. I try to use URIResolver with ServletContext and
"servlet-context:" for accessing external resource in xsl with
"<fo:external-graphic src="servlet-context:path
webapp/images/nameGifImage.gif">". This is work fine but i prefere that fop
access resource without serveletContext but with the ClassLoader without
placing images in a context web root. I try to place my images in a
application class-path where fop is embed but this not work. Anybody now how
can i solve my problem? How can find where fop external resource would be
place? 

Thank you very much

Roby
-- 
View this message in context:
http://old.nabble.com/problem-resolve-external-image-resource-with-fop-tp316
35640p31635640.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1325 / Virus Database: 1509/3644 - Release Date: 05/17/11



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

Reply via email to