You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Savino, Matt C" <Ma...@questdiagnostics.com> on 2002/02/12 20:42:19 UTC

RE: newbie needs help with relative address for image.

FYI - I still can't get this to work for a relative file path. Since I have
NT dev boxes and Unix QA and Prod, I have to feed the explicit PDF filepath
to the stylesheet as a parameter. I get the filepath form a
environment-level properties file. Still looking for that elusive XSLT
relative filepath if anyone has found it.

Here's our solution if it helps anyone:

<<< XSLT >>>
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
	xmlns:fo="http://www.w3.org/1999/XSL/Format">

 <xsl:param name="pdfImagePath" />

(...)

    <fo:external-graphic
src="{concat($pdfImagePath,'ClinTrialLogoGreenBig.gif')}" />

(...)

<<< Servlet Piece >>>
      transformer.setParameter("pdfImagePath", 
 
getServletConfig().getServletContext().getAttribute("pdfImagePath"));


-Matt


> -----Original Message-----
> From: Rob Smith [mailto:rob.smith@ifrsys.com]
> Sent: Tuesday, January 29, 2002 1:55 AM
> To: fop-dev@xml.apache.org
> Cc: 'Troy Bottger'
> Subject: RE: newbie needs help with relative address for image.
> 
> 
> 
> > From: Troy Bottger
> >...
> > <fo:external-graphic height="24mm" width="66mm"
> src="{../companylogo/url}"/>
> > It is just when I specify the relative address when I get:
> > Error while creating area : Invalid Image URL - error on 
> relative URL : no
> > protocol: null/abc/images/merchant_logo.gif
> 
> Try src="file:{../companylogo/url}"
> --
> Rob Smith
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: newbie needs help with relative address for image.

Posted by Scott Moore <sm...@novacoxmail.com>.
You can configure FOP to start all relative paths at a certain directory.
That's what I do in my servlet:

    org.apache.fop.configuration.Configuration.put("baseDir", "file:" + dir
     + File.separator);

----- Original Message -----
From: "Savino, Matt C" <Ma...@questdiagnostics.com>
To: <fo...@xml.apache.org>; <ro...@ifrsys.com>
Sent: Tuesday, February 12, 2002 2:42 PM
Subject: RE: newbie needs help with relative address for image.


> FYI - I still can't get this to work for a relative file path. Since I
have
> NT dev boxes and Unix QA and Prod, I have to feed the explicit PDF
filepath
> to the stylesheet as a parameter. I get the filepath form a
> environment-level properties file. Still looking for that elusive XSLT
> relative filepath if anyone has found it.
>
> Here's our solution if it helps anyone:
>
> <<< XSLT >>>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format">
>
>  <xsl:param name="pdfImagePath" />
>
> (...)
>
>     <fo:external-graphic
> src="{concat($pdfImagePath,'ClinTrialLogoGreenBig.gif')}" />
>
> (...)
>
> <<< Servlet Piece >>>
>       transformer.setParameter("pdfImagePath",
>
> getServletConfig().getServletContext().getAttribute("pdfImagePath"));
>
>
> -Matt
>
>
> > -----Original Message-----
> > From: Rob Smith [mailto:rob.smith@ifrsys.com]
> > Sent: Tuesday, January 29, 2002 1:55 AM
> > To: fop-dev@xml.apache.org
> > Cc: 'Troy Bottger'
> > Subject: RE: newbie needs help with relative address for image.
> >
> >
> >
> > > From: Troy Bottger
> > >...
> > > <fo:external-graphic height="24mm" width="66mm"
> > src="{../companylogo/url}"/>
> > > It is just when I specify the relative address when I get:
> > > Error while creating area : Invalid Image URL - error on
> > relative URL : no
> > > protocol: null/abc/images/merchant_logo.gif
> >
> > Try src="file:{../companylogo/url}"
> > --
> > Rob Smith
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> > For additional commands, email: fop-dev-help@xml.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org