xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Müller <pym...@yahoo.de>
Subject AW: AW: Generate Black and White PDF's
Date Thu, 26 Apr 2007 13:50:01 GMT
hey thanks a lot for you replies,
i had that feeling that it might be not possible just to say "serialize="BlackAndWhitePlease"
;-)
anyway, i think converting every color in gray scales is the best solution so far.
thanks, 
matthias


----- Ursprüngliche Mail ----
Von: Abel Braaksma <abel.online@xs4all.nl>
An: fop-users@xmlgraphics.apache.org
Gesendet: Montag, den 23. April 2007, 14:57:07 Uhr
Betreff: Re: AW: Generate Black and White PDF's

Matthias Müller wrote:
> hi again ;-)
>
> Ok, maybe i didn't expressed my needs correctly.
> At the moment i generate PDF files using FOP. This PDF files are colored.
> What i need now is a way to tell my FOP Serializer to make the same 
> output in gray scales, WITHOUT changing the color properties of each 
> colored block.
> Got Me ;-)

So, basically, you want the same as what happens when you print anything 
that has colored to a gray-scale printer, right? What you need is two 
FOP files, of course, and you XSLT process (I assume you use XSLT for 
getting your FOP files, but I can't tell for sure of course) is best 
split in two phases (or, if you can use the exslt:node-set extension in 
xslt 1.0, or if you use xslt 2.0, you can use temporary trees), where 
the first phase is your colored transform and the second phase 
calculates the gray scales from this (using, of course, an modified 
identity transformation that only changes the attributes with color 
information).

Google a bit around and you will find plenty of algorithms for getting 
from color to gray scale.

An idea to get the all properties that have color information:

<xsl:template match="@*[starts-with(., 'rgb(') or starts-with(., '#') or 
starts-with('cmyk(')]" >
   <xsl:attribute name="{name()}">
      <xsl:call-template name="color-to-bw">
         <xsl:with-param name="color-value" select="." />
      </xsl:call-template>
    </xsl:attribute>
</xsl:template>


Good luck coding!

-- Abel Braaksma

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org






      Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen
Yahoo! Mail. www.yahoo.de/mail

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message