color problem with afp

Here should go questions about transforming XML with XSLT and FOP.
zouarino
Posts: 3
Joined: Mon Jul 09, 2018 12:08 pm

color problem with afp

Post by zouarino » Fri Sep 21, 2018 6:23 pm

Hello,
I have a color display problem in the afp format.
instead of red, the svg image is in black.

Code: Select all



<fo:table>
<fo:table-column column-width="400pt" border="0.5pt solid black" />
<fo:table-header>
<fo:table-row>
<fo:table-cell border="0.5pt solid black">
<fo:block font-weight="bold">Price</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="0.5pt solid black" width="200" height="150">
<fo:block color="oca(red)">Red</fo:block>
<fo:block></fo:block>
<fo:block-container position="absolute" >
<fo:block>
<fo:instream-foreign-object>
<svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="200" height="150" viewBox="0 0 200 150">
<svg:path stroke-width="0.5" stroke="none" d="M0 0 L200 150" fill="rgb(0,255,0)" />
<svg:path stroke-width="0.5" stroke="none" d="M0 150 L200 0" fill="rgb(0,255,0)" />
</svg:svg>
</fo:instream-foreign-object>
</fo:block>
</fo:block-container>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>



Radu
Posts: 6335
Joined: Fri Jul 09, 2004 5:18 pm

Re: color problem with afp

Post by Radu » Mon Sep 24, 2018 7:25 am

Hi,

In your XSL-FO file you specify the foreground color as oca(red). The XSL-FO specification states what functions can be used to specify colors and "oca" is not one of them:

https://www.w3.org/TR/xsl11/#expr-color-functions

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply