Re: Re: Problem with scaling png image file in svg

2004-02-10 Thread Jay Chiu

I think changing org.apache.fop.svg.PDFGraphics2D class may
solve the image quality issue. Because PDFGraphics2D class
hangles the image drawing. Can Fop developer please give me some
help?

I tried to debug through fop with batik and find the call stack
for handling my png image is as following:

(1)org.apache.fop.svg.PDFGraphics2D.drawImage(Image img, int x,
int y,ImageObserver observer)
(2)org.apache.batik.ext.awt.image.GraphicsUtil.drawImag(Graphics2D
g2d, CachableRed cr):152
(3)org.apache.batik.ext.awt.image.GraphicsUtil.drawImag(Graphics2D
g2d, CachableRed cr):439
(4)org.apache.batik.gvt.primitivePaint(Graphics2D g2d):92
(5)org.apache.batik.gv.AbstractGraphicsNode.paint(Graphics2D
g2d):485
(6)org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(Graphics2D
g2d):130
(7)org.apache.batik.gv.AbstractGraphicsNode.paint(Graphics2D
g2d):485
(8)org.apache.batik.gvt.ImageNode.paint(Graphics2D g2d):34
org.apache.batik.gv.AbstractGraphicsNode.paint(Graphics2D g2d)

From the call stack info, it is clear that PDFGraphics2D handles
the actual external image drawing. Can someone change
PDFGraphics2d to use the same approach to handle external image
file as other image handling code in FOP does?

Thanks.

Jay

  On Sat, 07 Feb 2004, Jay Chiu ([EMAIL PROTECTED])
wrote:
 
 Thanks Thomas,
  
 I guess anyone who includes images in SVG may get the same
 problem. 
 
 We are delivering a report tool to client and the client is
 complaining about the chart quality in pdf. Thus we are in a
 hurry to solve this isse. 
 
 If someone has already written some code to solve this issue,
 please forward me some of your code.
 
 If it is not too difficult, can you please give me some hint
and
 tell me which file should be changed? I guess probably we may
 take some fop's code to solve this issue, becuase the
 subsampling works fine in Fop.
 
 Thanks a lot.
  
 Jay
 
  ==
  Subject: Re: Problem with scaling png image file in svg 
  From: Thomas DeWeese [EMAIL PROTECTED] 
  Date: Fri, 06 Feb 2004 06:25:45 -0500 
  To: batik-dev@xml.apache.org 
  
 


  
  Jay Chiu wrote:
  
   I tried with Batik Squiggle for the png images. If I does
 not
   use g transform=scale(xxx), the png image looks good
in
  the
   GUI, it does get scaled properly. But image with scale()
   transform attribute losses quality, and the png file
  generated
   by Squiggle is in bad quality. 
  
  The problem is that you are asking to subsample the
image
  too much.  The large image is reduced by 5x the small by
10x.
  Batik does not prefilter for large subsample values so you
  'loose' pixels with subsample values this high and the
result
  is aliasing effects.
  
  If anyone wants to write/contribute a block average or
  better
  a true prefiltered resample operation I'm sure it would be
  appreciated.  I can help with plugging it into Batik in the
  right spot.
  
   I am also sending the email to batik-user mail list. Hope
  Batik
   team can also help.
   
   Attache please find a svg file , a source png file and
   generated
   png file.
   
   Thanks a lot.
   
   Jay
   
  
  
  
  
  Get your own 800 number
  Voicemail, fax, email, and a lot more
  http://www.ureach.com/reg/tag
  
  
 
 
 



Get your own 800 number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

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



Re: Positioning of block at the end of the before region

2004-02-10 Thread Chris Bowditch
Emmanuel Cuevas Rodriguez wrote:
Hi everyone !!!
I have been trying all day long to place a block at the end of the region 
before, but I haven't acieved it... I've read the FOP manual and FAQs, but 
there's nothing that seems to help me...
Here is what I want to do:
++
| region-before  |
||
|+--+|
||  ||
|| block_1  ||
|+--+|
||
||
|+--+|
||  ||
|| block_2  ||
|+--+|
++
The block_1 block, is not a fix one, it can change the number of lines in it, and I must let de block_2 block fixed whatever happens in the region...
A fo:block-container can be used to absolutely position a block in a 
page, e.g.

fo:block-container position=absolute left=0cm top=4cm 
width=15cm height=2cm

The only trouble is that I'm not sure if it works in static-content. The 
website says it must be direct descendent of fo:flow. I know that you 
cannot nest it within other blocks. Give it a try in static-content and 
post back what you find.

Other possible solutions include using nested tables in the static 
content. The outer table has 2 rows, the first with a fixed height.

snip/
Chris


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


RE: How to capitalize text ???

2004-02-10 Thread Dang Minh Phuong
It works. Thank you very much.

-Original Message-
From: Wouter de Vaal [mailto:[EMAIL PROTECTED] 
Sent: Sunday, February 08, 2004 11:16 PM
To: [EMAIL PROTECTED]
Subject: Re: How to capitalize text ???

You should use XSLT for this:

xsl:variable name=uppercaseABCDEFGHIJKLMNOPQRSTUVWXYZ/xsl:variable

xsl:variable name=lowercaseabcdefghijklmnopqrstuvwxyz/xsl:variable

xsl:template match=text()
   xsl:value-of select=translate(.,$lowercase,$uppercase)/
/xsl:template

This will translate all lowercase text in XML to uppercase.

Wouter

- Original Message - 
From: Dang Minh Phuong
To: '[EMAIL PROTECTED]'
Sent: Monday, February 09, 2004 3:50 AM
Subject: How to capitalize text ???


Hi all,

I have a text received from the DB and put in xml file. Now I want to
capitalize that text when showing it in PDF using FOP. How can I do that ???

Thanks for your help.

-
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]



Re: Positioning of block at the end of the before region

2004-02-10 Thread Mark Williams

 
 The only trouble is that I'm not sure if it works in static-content. The 
 website says it must be direct descendent of fo:flow. I know that you 
 cannot nest it within other blocks. Give it a try in static-content and 
 post back what you find.

Yes it does.  Use it all the time.

Regards

Mark

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



RE: Problems with Saxon - FOP?

2004-02-10 Thread Andreas L. Delmelle
 -Original Message-
 From: Rauh, Michael [mailto:[EMAIL PROTECTED]


 Running the FO docs produced by Saxon through FOP standalone
 worked, as long as the files were ISO-8859-1 encoded. That
 aroused suspicion that there's a wrong encoding somewhere in the
 chain. I'll try to track this down.


Hmm. Could it be that FOP's choking on a UTF-BOM of some sort? (Since it
doesn't happen when using ISO-8859-1 encoding...)?


Cheers,

Andreas


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



RE: Positioning of block at the end of the before region

2004-02-10 Thread Emmanuel Cuevas Rodriguez
Hi Chris !

I've followed your advise and I tried the block-container absolute 
positioning... and it works !!! I put the container in the begining of the 
region and the other blocks do not seem to be disturbed...

Thanx a lot !


Emmanuel Cuevas
Senior Developer

-Mensaje original-
De: Chris Bowditch [mailto:[EMAIL PROTECTED]
Enviado el: Martes, 10 de Febrero de 2004 04:01 a.m.
Para: [EMAIL PROTECTED]
Asunto: Re: Positioning of block at the end of the before region


Emmanuel Cuevas Rodriguez wrote:

 Hi everyone !!!
 
 I have been trying all day long to place a block at the end of the region 
 before, but I haven't acieved it... I've read the FOP manual and FAQs, but 
 there's nothing that seems to help me...
 
 Here is what I want to do:
 
 ++
 | region-before  |
 ||
 |+--+|
 ||  ||
 || block_1  ||
 |+--+|
 ||
 ||
 |+--+|
 ||  ||
 || block_2  ||
 |+--+|
 ++
 
 The block_1 block, is not a fix one, it can change the number of lines in it, 
 and I must let de block_2 block fixed whatever happens in the region...

A fo:block-container can be used to absolutely position a block in a 
page, e.g.

fo:block-container position=absolute left=0cm top=4cm 
width=15cm height=2cm


The only trouble is that I'm not sure if it works in static-content. The 
website says it must be direct descendent of fo:flow. I know that you 
cannot nest it within other blocks. Give it a try in static-content and 
post back what you find.


Other possible solutions include using nested tables in the static 
content. The outer table has 2 rows, the first with a fixed height.

snip/

Chris





-
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]



Determine Pagebreaks?

2004-02-10 Thread Readman, Devon
Is there anyway in fop 0.20.5 to determine when a page break has occured?
For example, I need to be able to redisplay a document section heading (e.g.
'Section 2 Continued...') when the section is spread over multiple pages.
Thanks.

Devon

Devon Readman
Programmer Analyst
Business Solutions Division
Human Services IIT Cluster
(613) 548-6318

I trade it all for a little more. C. Montgomery Burns


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



RE: Determine Pagebreaks?

2004-02-10 Thread George Yi
Use break-fore or break-after attr in your block.

George

-Original Message-
From: Readman, Devon [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 10, 2004 10:05 AM
To: [EMAIL PROTECTED]
Subject: Determine Pagebreaks?

Is there anyway in fop 0.20.5 to determine when a page break has
occured?
For example, I need to be able to redisplay a document section heading
(e.g.
'Section 2 Continued...') when the section is spread over multiple
pages.
Thanks.

Devon

Devon Readman
Programmer Analyst
Business Solutions Division
Human Services IIT Cluster
(613) 548-6318

I trade it all for a little more. C. Montgomery Burns


-
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]



RE: Determine Pagebreaks?

2004-02-10 Thread Andreas L. Delmelle
 -Original Message-
 From: Readman, Devon [mailto:[EMAIL PROTECTED]

 Is there anyway in fop 0.20.5 to determine when a page break has occured?

Nope. (Well, not through XSL-FO anyway; you would need to directly talk to
the AreaTree to achieve that...)

 For example, I need to be able to redisplay a document section
 heading (e.g.
 'Section 2 Continued...') when the section is spread over multiple pages.

You may want to take a closer look at fo:marker/fo:retrieve-marker to
achieve a similar effect.
( see the sample files in FOP_HOME/examples/fo/markers to get the idea )
If you it's no problem to alter the XML/XSL in such a way to add markers to
every section, it should be a piece of cake :)

Hope this helps!

Cheers,

Andreas


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



Re: Determine Pagebreaks?

2004-02-10 Thread Chris Pratt
I'm not sure that this will work (I'm making it up as I go) but couldn't you
use the grouping trick with the page number to test when the page number
changes between elements?
  (*Chris*)

- Original Message - 
From: Andreas L. Delmelle [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 9:32 am
Subject: RE: Determine Pagebreaks?


  -Original Message-
  From: Readman, Devon [mailto:[EMAIL PROTECTED]
 
  Is there anyway in fop 0.20.5 to determine when a page break has
occured?

 Nope. (Well, not through XSL-FO anyway; you would need to directly talk to
 the AreaTree to achieve that...)

  For example, I need to be able to redisplay a document section
  heading (e.g.
  'Section 2 Continued...') when the section is spread over multiple
pages.

 You may want to take a closer look at fo:marker/fo:retrieve-marker to
 achieve a similar effect.
 ( see the sample files in FOP_HOME/examples/fo/markers to get the idea )
 If you it's no problem to alter the XML/XSL in such a way to add markers
to
 every section, it should be a piece of cake :)

 Hope this helps!

 Cheers,

 Andreas


 -
 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]



Re: Error areas pending text probably lost

2004-02-10 Thread Abhijit Junnare
So there is nothing that I can really do but when the
problem appears change my source fo ( or source xml in
my case)
Thanks for the help.
Abhi
--- J.Pietschmann [EMAIL PROTECTED] wrote:
 Andreas L. Delmelle wrote:
  Nested inlines... My guess is: there's the bugger!
 
 Correct.
 
  Can you try rendering again, but replacing the
 inner fo:inline in the above
  snippet with an fo:wrapper,
 
 Won't work. The problem is as follows: The line
 layout is
 called with a bunch of characters. It is scanned for
 possible
 line breaks, more or less whitespace (which is
 incomplete in
 itself). If the character sequence is exhausted
 before a break
 possibility is encountered but there's still space
 left in
 the line, the text snippet processed so far is
 stored in
 the pending area list, because it might be wrapped
 to the
 next line. Upon the next call, scanning proceeds,
 and if
 the line is full without finding a break possiblity,
 processing is unwound unto the block, which
 generates a new
 line. This new line grabs the pending area list from
 the
 previous line and adds it to itself, because it's
 word content
 which had been wrapped.
 
 The problem occurs if the overflowed line is at the
 end of the
 page, because the block layout code which would
 otherwise
 generate a new line returns up to the page layout
 loop.
 New block areas are created, the link to the line
 with the
 non-empty pending area list is lost, and the new
 line starts
 without the wrapped text. The error message is
 generated in
 the renderer which simply looks at the pending area
 list of
 the line, which should have been emptied.
 
 The problem occurs rarely because it only happens if
 a word is
 fragmented so that the pending area list is filled.
 Because
 some code accumulates the SAX character events, only
 inline
 FOs which mark parts of a word may cause this. The
 only way
 around the bug is to eliminate the inline FOs, or
 fine tune
 display space in order to avoid having the content
 in question
 falling at the edge of a page.
 
 A similar, but code-wise unrelated bug occurs when
 an inline
 graphic is added which is too high to fit the
 available space
 on the page: the text already in the line is lost.
 Fortunately,
 FOP can't cope with dynamic line height anyway, so
 people
 rarely do this.
 
 
 J.Pietschmann
 

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


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: Problems with Saxon - FOP?

2004-02-10 Thread J.Pietschmann
Rauh, Michael wrote:
I'm running XSLT transformations from within Java and put the result DOM into
FOP's AWTRenderer. ... That's all working fine with Xalan (from the JDK) and
 jd.xslt. But with Saxon 6.5.3 and Saxon 7.8, FOP throws NullPointerExceptions.
 Here's the ouput when using Saxon-6.5.3:
...
[ERROR] Unsupported element encountered: null (Namespace: null). Source
context: unavailable
I use Saxon with FOP all the time. However, I use SAX to pipe
the transformation result to the FOP driver (see
 http://xml.apache.org/fop/embedding.html#ExampleXML2PDF)
I guess there is a problem with the DOM or the DOM walker
implementation, or perhaps you screwed the DOM while
postprocessing. If you dont process the transformation result,
I recommend using SAX, it's more ressource friendly anyway
(less memory).
J.Pietschmann
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Determine Pagebreaks?

2004-02-10 Thread J.Pietschmann
Chris Pratt wrote:
I'm not sure that this will work (I'm making it up as I go) but couldn't you
use the grouping trick with the page number to test when the page number
changes between elements?
Transformation and FO layout are two different processing stages. There
is no way (well, no standardized way) feed back information from the
layout to the XSL transformation. This means, whatever you do in the
transformation, you wont get page numbers. A fo:page-number/ or
fo:page-number-reference/ will *not* evaluate to a page number during
the transformation.
J.Pietschmann
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]