You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jessica Niewint <j....@kiosco.org> on 2002/12/11 15:15:01 UTC
Problems with
Hi, for me it seems to be impossible to generate a PDF with graphics.
I use (cocoon 2.0.3 with java 1.4) ...
The data come from a database (via xsp).
The variable $sectioncontent contains a path to an image (Like:
http://www.myserver.com/xyz.jpg) .
In the <fo:external-graphic ...> tag I use this var to define the src
(src="$sectioncontent").
<xsl:for-each select="SecContent">
<xsl:variable name="sectioncontent"
select="."/>
<fo:block font-size="12pt"
font-style="italic" space-after="2mm">
<xsl:if
test="contains($sectioncontent, '.jpg')">
<fo:block align="center">
<!-- here external graphic -->
<fo:external-graphic
src="$sectioncontent" content-height="100%" content-width="100%"/>Image here
</fo:block>
</xsl:if>
<fo:block font-size="12pt"
font-style="italic" space-after="2mm">
<xsl:value-of select="."
disable-output-escaping="yes"/>
</fo:block>
</fo:block>
</xsl:for-each>
</fo:block>
But no image will be displayed in the pdf file, even if I put a static path
in to the <fo:external-graphic> tag : nothing !
Is there something I have to know ? Sitemap, Cocoon ???
I have to generators with html everything will be shown correctly....
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Problems with
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Jessica Niewint wrote:
> The variable $sectioncontent contains a path to an image (Like:
> http://www.myserver.com/xyz.jpg) .
If you point a browser to this address, do you see the image?
> <fo:external-graphic src="$sectioncontent" content-height="100%"
> content-width="100%"/>Image here
Apart from the problems mentioned elsewhere, content-height
and content-width are not implemented. If you want your image
to have specific measurements, use height and/or width with
absolute measurements (cm, in or pt, not %). If you use both
height and width, your image will be stretched, otherwise
the aspect ratio is conserved. If you omit both height and
width, your image will be rendered with a 72dpi resolution.
This may overflow the available space, which in turn may
cause the image to be dropped (you should see an overflow mark
in the logs).
J.Pietschmann
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Problems with
Posted by Joerg Heinicke <jo...@gmx.de>.
Hello Jessica,
can you view the resulting XSL FO code (serializing it with XML
serializer)? Does it contain the <fo:external-graphic/>?
Furthermore you have a XSLT error:
<fo:external-graphic src="$sectioncontent" content-height="100%"
content-width="100%"/>
This should create a src attribute containing the *value*
"$sectioncontent". If you want to replace it with the content of
$sectioncontent, change it to
src="{$sectioncontent}"
using Attribute Value Template (AVT).
Absolute paths (both http:// and file://) shell work.
Regards,
Joerg
Jessica Niewint wrote:
> Hi, for me it seems to be impossible to generate a PDF with graphics.
>
> I use (cocoon 2.0.3 with java 1.4) ...
> The data come from a database (via xsp).
>
> The variable $sectioncontent contains a path to an image (Like:
> http://www.myserver.com/xyz.jpg) .
> In the <fo:external-graphic ...> tag I use this var to define the src
> (src="$sectioncontent").
>
> <xsl:for-each select="SecContent">
> <xsl:variable name="sectioncontent"
> select="."/>
> <fo:block font-size="12pt"
> font-style="italic" space-after="2mm">
> <xsl:if
> test="contains($sectioncontent, '.jpg')">
> <fo:block align="center">
> <!-- here external graphic -->
>
> <fo:external-graphic src="$sectioncontent" content-height="100%"
> content-width="100%"/>Image here
>
> </fo:block>
> </xsl:if>
> <fo:block font-size="12pt"
> font-style="italic" space-after="2mm">
> <xsl:value-of select="."
> disable-output-escaping="yes"/>
> </fo:block>
>
> </fo:block>
> </xsl:for-each>
> </fo:block>
>
>
> But no image will be displayed in the pdf file, even if I put a static
> path in to the <fo:external-graphic> tag : nothing !
> Is there something I have to know ? Sitemap, Cocoon ???
> I have to generators with html everything will be shown correctly....
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: stops to work
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Jessica Niewint wrote:
> Thank you all for your help. Yesterday everything works fine ... today
> xsp somehow stops to work ... no image will be shown only the text ... I
> really have any idea what could be wrong
So if you have an idea....just follow it...
>
> <xsl:for-each select="SecContent">
> <xsl:variable name="sectioncontent" select="."/>
> <xsl:choose>
> <xsl:when
> test="contains($sectioncontent, 'http://myserver.it')">
> <fo:block>Here image
>
> <fo:external-graphic src="{$sectioncontent}"/>
> </fo:block>
> </xsl:when>
Serialize the result of the transformation as XML and check whether
there is a fo:external-graphics there. You might have an unexpected
value in $sectioncontent.
> <xsl:otherwise>
> <fo:block
> font-size="12pt" font-style="italic" space-after="2mm">
> <xsl:value-of
> select="." disable-output-escaping="yes"/>
Disable-output-escaping does not work in Cocoon. Serach the XSL list
archive for explanation:
http://www.mulberrytech.com/xsl/xsl-list/
Its unlikely that this has something to do with your problem though.
BTW you should take some days to learn more about the concepts you use,
you seem to be somewhat confused. Also, both your source formatting and
debugging skills could use some polishing. In general, it is unwise to
use complex frameworks like Cocoon at early stages of style sheet
development, often it is much faster to use an IDE and deploy to Coccon
only after the bulk of the work is done.
J.Pietschmann
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
stops to work
Posted by Jessica Niewint <j....@kiosco.org>.
Thank you all for your help. Yesterday everything works fine ... today xsp
somehow stops to work ... no image will be shown only the text ... I really
have any idea what could be wrong
<xsl:for-each select="SecContent">
<xsl:variable name="sectioncontent" select="."/>
<xsl:choose>
<xsl:when
test="contains($sectioncontent, 'http://myserver.it')">
<fo:block>Here image
<fo:external-graphic
src="{$sectioncontent}"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block font-size="12pt"
font-style="italic" space-after="2mm">
<xsl:value-of
select="." disable-output-escaping="yes"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>