format-number rounding error

2004-05-13 Thread lijun zou
Hi, I am trying to generate PDF using FOP. 
But I got a rounding error when using the following
fo script
fo:block
xsl:value-of select=format-number(0.5,'0')/
/fo:block

The result from fop is
0
instead of 
1

Is this a bug?
How do we get around of it?

Thanks

LZ




__
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2'
http://movies.yahoo.com/showtimes/movie?mid=1808405861 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: CMKY

2003-10-10 Thread lijun zou
Another question,
How can I mathematically convert RGB to CMYK?
Theoreically it's 1- RGB, but what about K value?

LZ

--- Beer, Christian [EMAIL PROTECTED] wrote:
  I think CMYK support in tools used early in the
 publishing chain
  is somewhat overrated.
 
 Right, but FOP _MUST_ not be early in the publishing
 chain! It could
 in fact be the only and therefore even the last step
 in a publishing
 chain...
 
 
  I can only think of the following use cases for
 XSLFO:
  - Avoid round-off errors and other numerical
 problems in the
conversion CMYK-sRGB-CMYK, perhaps in order to
 match exactly
colors of embedded CMYK bitmap images in text,
 borders and
background.
 
 Conversion CMYK - RGB is nearly always lossy. And
 for print sRGB 
 is also not that perfect (because of it's small
 gammut (nearly the 
 smalest gammut of all RGB colorspaces)).
 
 
  - Get color values into the document which can't
 be expressed
as RGB. I don't know whether this can even
 happen.
 
 If you create PDFs for print, you nearly always want
 CMYK! Okay, 
 RGB and colorspace would be great but nowaday not
 all print-
 companys now how to handle colorspaces (for example
 PDF/X-3).
 
 
 
  As far as round-off goes, AFAIK the transformation
 from CMYK to
  RGB and vice versa is linear and numerically well
 behaved with
  the exception of some extreme saturated colors, in
 particular
  very dark colors. I've never heard of anyone
 noticing these
  kind of problem without deliberately using a
 somewhat braindamaged
  tool for colorspace conversion which rounded all
 values to two
  significant digits *and* both a quite expensive
 printing kit and
  a well trained eye.
 
 100% c83% c
   0% m 5% m
   0% y-- sRGB--  2% y
   0% k 0% k
 
 So in fact, CMYK - sRGB - CMYK is not linear. If
 you convert the 
 result to sRGB and again back the values will even
 be more bad.
 
  
  J.Pietschmann
  
  
 
 Christian Beer
 
 
  
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: CMKY

2003-10-09 Thread lijun zou
Thanks for the so many replies.

Ben's idea is especially helpful. I've been following
up on that in last few days.
Looks like in the output method in PDFDocument.java,
we can intercept each PDFObject before it is printed
to pdf file, if it's a PDFStream object, we can decode
the data string and do the replacement Ben suggested,
and then put it back to PDFStream.

I hope I don't miss any piece.

LZ

--- Ben Galbraith [EMAIL PROTECTED] wrote:
 iText can't do the manipulation in question, but
 Multivalent 
 (sourceforge) might do the trick.  Multivalent
 didn't successfully 
 uncompress the objects in my largish 80 MB PDF,
 however.
 
 I wound up home-growing my own utilities to
 post-process the PDF as a 
 learning exercise.  Took about a day.  PDF is a
 well-documented format 
 and uses well-documented widely-supported
 compression algorithms.
 
 We actually use iText to create composite PDFs (two
 or more PDFs placed 
 on top of each other) and our utility to add the
 spot colors or convert 
 to CMYK programmatically.
 
 I wish I could share some of our code... working on
 getting approval to 
 open-source some of it.
 
 Ben
 
 George Yi wrote:
 
  I heard Jeremias mentioned Chamelon(Spell) Colour
 can do the post process
  but I never tried.
  
  George
  
  -Original Message-
  From: Clay Leeds [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, October 07, 2003 11:59 AM
  To: [EMAIL PROTECTED]
  Subject: Re: CMKY
  
  
  Ben Galbraith wrote:
  
 FOP does support CMYK JPEGs -- there's a previous
 thread on this issue
 that I participated in that should document it
 fairly well.
 
 XSL-FO may provide support for CMYK through its
 color space features;
 haven't studied it enough to grok it, not sure.
 
 FOP doesn't not support CMYK for the elements it
 renders.  However, I've
 found that post-processing the PDF is actually
 fairly straight-forward
 and enables introduction of both spot colors and
 CMYK colors.  This
 process involves searching through each object in
 the PDF and replacing
 the RGB commands (PDF: rg/RG) with CMYK (PDF: k/K)
 or color space (PDF:
 cs/CS, scn/SCN) commands.  It seemed scary at
 first, but actually not
 that bad.  If anyone has interest in learning more
 about this technique,
 let me know.
 
 Ben
  
  
  I'm interested in this topic more because I'd like
 to add this type of
  information to the FOP web site than for any other
 reason (my company
  currently doesn't really care *that* much about
 color--but I'm
  interested!). I assume you use some sort of
 post-processor like iText or
  something? If you could create some sort of
 tutorial or something on how
  to do this, I think it would be *very* useful.
 Sounds intriguing!
  
  Web Maestro Clay
  
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
  
  
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
  
  
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



CMKY

2003-10-07 Thread lijun zou
I am in a process of evaluating PDF creation software.
FOP looks very attractive to me.
But I have one question:
How is the CMKY colorspace supported in FOP?
Does it support at embedded SVG level too?
Any examples about this?
Thanks

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]