XSL-FO is not capable to append a PNG graphic

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

XSL-FO is not capable to append a PNG graphic

Abel Carvajal Tapia
The PDF generated by XSL-FO is not capable to append a PNG graphic

1. The JfreeChart /chartDisplay?filename=jfreechart-59226.png servlet checks
if the graphic is being served created by the current user or that it begins
with "public", nevertheless, there is not parameter useful in the
JfreeChart ServletUtilities.saveChartAsPNG to set the name as "public" , so
lamentably this graphic is not available for other sessions. Is there any
way to access it?
 
2. By other hand, I  manually renamed the file (the generated graphic) to
public* (comment for servlet in jfreechart source code) and I successful recovered it.
But I had another problem, the <fo:external-graphic> in
XSL-FO transformation does not append PNG images to the pdf even when the
servlet is serving /chartDisplay?filename=public-jfreechart-59226.png.

I tried the same with JPG images and the PDF was successful generated.
I tried the same with other PNG images and is not capable to append.

So, I would like to know if this is a known bug, is there any other
way to do this (a workaround), or I'm just doing something wrong.


Following some source code ...

do-generate-pdf.xpl

    <p:param name="data" type="output" />

    <p:processor name="oxf:pipeline">
        <p:input name="instance" href="../xforms/chart-xforms-model.xml"/>
        <p:input name="config" href="do-load-charts.xpl"/>
        <p:output name="data" id="chart"/>
    </p:processor>
        ..................

    <p:processor name="oxf:xslt">
        <p:input name="data" href="#data"/>
        <p:input name="config" href="../xslt/xml-to-html.xsl"/>
        <p:output name="data" id="html"/>
    </p:processor>
   
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#html"/>
        <p:input name="config" href="../xslt/html-to-pdf-fo.xsl"/>
        <p:output name="data" ref="data"/>
    </p:processor>

do-load-charts.xpl

    <p:param name="instance" type="input"/>
    <p:param name="data" type="output" />

    <p:processor name="oxf:xslt">
        <p:input name="data" href="#instance"/>  
        <p:input name="config">
            <form xsl:version="2.0">
                <data>
                    <entries>
                        <xsl:copy-of
select="/form/data/entries/entry[selected='true']"/>
                    </entries>
                </data>
            </form>
        </p:input>
        <p:output name="data" id="data"/>
    </p:processor>
   
    <p:processor name="oxf:chart">
        <p:input name="data" href="#data"/>
        <p:input name="chart" href="#instance#xpointer(/form/chart)"/>
        <p:input name="config">
            <config/>
        </p:input>
        <p:output name="data" ref="data" />
    </p:processor>

html-to-pdf-fo.xsl
....
....
<xsl:variable
name="src2">http://localhost:8080/test/chartDisplay?filename=jfreechart-5922
6.png</xsl:variable>
<fo:external-graphic>
   <xsl:attribute name="src">
     <xsl:value-of select="$src2"/>                  
   </xsl:attribute>
</fo:external-graphic>
....
....

Thanks in advance





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: XSL-FO is not capable to append a PNG graphic

Claudio Delgado
Hi,

Alex has written on Oct 5, 2006, in the e-mail titled: [ops-users] Xslfo,
may be that gives you some directions.

I never tried to generate a chart with the chart processor and then
reference it from XSL:FO. First, can you access
http://localhost/ops/chartDisplay?filename=jfreechart-24390.png from
your browser?

If you can access it from the browser, but that FOP can't, I suspect
that this is because the /chartDisplay servlet checks that user that
requests the chart is the same as the one who asked for that chart to
be produced. This means that if FOP does not forward cookies while
handling fo:external-graphic, then /chartDisplay will think that the
request comes from a different user, and respond with a 500.

Alex

-----Mensaje original-----
De: Abel Carvajal Tapia [mailto:[hidden email]]
Enviado el: lunes, 23 de octubre de 2006 10:22
Para: [hidden email]
Asunto: [ops-users] XSL-FO is not capable to append a PNG graphic

The PDF generated by XSL-FO is not capable to append a PNG graphic

1. The JfreeChart /chartDisplay?filename=jfreechart-59226.png servlet checks
if the graphic is being served created by the current user or that it begins
with "public", nevertheless, there is not parameter useful in the
JfreeChart ServletUtilities.saveChartAsPNG to set the name as "public" , so
lamentably this graphic is not available for other sessions. Is there any
way to access it?
 
2. By other hand, I  manually renamed the file (the generated graphic) to
public* (comment for servlet in jfreechart source code) and I successful
recovered it.
But I had another problem, the <fo:external-graphic> in
XSL-FO transformation does not append PNG images to the pdf even when the
servlet is serving /chartDisplay?filename=public-jfreechart-59226.png.

I tried the same with JPG images and the PDF was successful generated.
I tried the same with other PNG images and is not capable to append.

So, I would like to know if this is a known bug, is there any other
way to do this (a workaround), or I'm just doing something wrong.


Following some source code ...

do-generate-pdf.xpl

    <p:param name="data" type="output" />

    <p:processor name="oxf:pipeline">
        <p:input name="instance" href="../xforms/chart-xforms-model.xml"/>
        <p:input name="config" href="do-load-charts.xpl"/>
        <p:output name="data" id="chart"/>
    </p:processor>
        ..................

    <p:processor name="oxf:xslt">
        <p:input name="data" href="#data"/>
        <p:input name="config" href="../xslt/xml-to-html.xsl"/>
        <p:output name="data" id="html"/>
    </p:processor>
   
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#html"/>
        <p:input name="config" href="../xslt/html-to-pdf-fo.xsl"/>
        <p:output name="data" ref="data"/>
    </p:processor>

do-load-charts.xpl

    <p:param name="instance" type="input"/>
    <p:param name="data" type="output" />

    <p:processor name="oxf:xslt">
        <p:input name="data" href="#instance"/>  
        <p:input name="config">
            <form xsl:version="2.0">
                <data>
                    <entries>
                        <xsl:copy-of
select="/form/data/entries/entry[selected='true']"/>
                    </entries>
                </data>
            </form>
        </p:input>
        <p:output name="data" id="data"/>
    </p:processor>
   
    <p:processor name="oxf:chart">
        <p:input name="data" href="#data"/>
        <p:input name="chart" href="#instance#xpointer(/form/chart)"/>
        <p:input name="config">
            <config/>
        </p:input>
        <p:output name="data" ref="data" />
    </p:processor>

html-to-pdf-fo.xsl
....
....
<xsl:variable
name="src2">http://localhost:8080/test/chartDisplay?filename=jfreechart-5922
6.png</xsl:variable>
<fo:external-graphic>
   <xsl:attribute name="src">
     <xsl:value-of select="$src2"/>                  
   </xsl:attribute>
</fo:external-graphic>
....
....

Thanks in advance







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws