Created attachment 24564 [details] sample fo and afp Color svg, declared both inline (<fo:instream-foreign-object>) and external (<fo:external-graphic>), are not rendered to afp as black and white under the following fop.xconf configuration: <renderer mime="application/x-afp"> <images mode="b+w" bits-per-pixel="8"/> .. </renderer> The attached includes sample xsl-fo and afp output to demonstrate.
Hi Peter, There is no bug with this functionality. You can have a look at the FO file that I have used... 1. Update the configuration file for the image mode (b+w or color) 2. Run the following command from the command prompt... C:\mywork\FOP\fop-0.95> fop -c C:\fop.xconf -fo C:\mywork\JavaXSLTSamples\XSLFOSamples\hello.fo -afp C:\mywork\JavaXSLTSamples\XSLFOSamples\hellotest.afp According to the mode, the image will be rendered with color or black and white... Thanks, Venkat.
Created attachment 24606 [details] Input FO file
I have checked this bug with FOP 0.95 version initially, but later understood that FOPTrunk is having this problem instead of FOP 0.95. The Bitmaps are rendering according the image mode configuration (either b+w or color) in both FOP 0.95 and FOPTrunk. The problem is with SVGs, the image mode is not respected in case of SVGs in FOPTrunk. So, It is a valid bug in FOPTrunk....
Peter, I understand the bug report (all colors should ideally be transformed to grayscales when AFP output is configured to 8bit grayscales), but what I'm curious about is whether the current behaviour actually caused a problem on your side. So far I have no reports that the colors cause any problems. The systems seem to be able to handle them correctly, even on a monochrome system. Only the bitmap images are currently reduced in color depth most of all because that has a huge impact on file size.
Jeremias, our local B+W AFP Printer handles this and converts the colour SVG to B+W on the fly. However, one of our customers with B+W Printers said the AFP failed to print due to the colour in the GOCA objects. We believe this is a bug and should be fixed. Thanks, Chris
Created attachment 24725 [details] patch of proposed fix Implements a grayscale color conversion utility that is used when setting the color value on the GOCA stream whilst rendering SVG to AFP in grayscale. WARNING This patch will depend upon an update to xmlgraphics-commons that includes the patch defined in Attachment #24724 [details] of bug 48405
Created attachment 24779 [details] patch of proposed fix
Created attachment 24818 [details] patch of proposed fix Updated patch. Moved some files to xmlgraphics commons
Thanks for the patch Peter. Committed to SVN in revision 897221
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed