Hi Jay,

   So, it wasn't clear that you were embedding these PNG's in a PDF.
In this case the problem is the Adobe rendering engine.  Well really
the problem is the fact that you are using PNG images where you
should be using a vector format like SVG.

   Where do these PNG image come from?  If they are generated from
Java you might look into using the SVGGraphics2D from Batik to
traslate the Java Draw calls into SVG which you can embed in the
FO document.

   The real issue is that if you subsample the PNG to ~72DPI to
give good screen drawing, then the printed version will be ugly,
and if you keep your current fairly high resolution version you
have 'poor' screen display.

   You might also consider 'redesigning' the graphs to work better
across multiple resolutions.  This would mean using a heaver/larger
font and a larger stroke width.  This might allow you to avoid going
the vector route - although the vector route would probably generate
smaller files that print and view better.

Jay Chiu wrote:

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

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)
g2d, CachableRed cr):152
g2d, CachableRed cr):439
(4)org.apache.batik.gvt.primitivePaint(Graphics2D g2d):92
(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?



---- On Sat, 07 Feb 2004, Jay Chiu ([EMAIL PROTECTED])


Thanks Thomas,

I guess anyone who includes images in SVG may get the same

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


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.


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: [EMAIL PROTECTED]


Jay Chiu wrote:

I tried with Batik Squiggle for the png images. If I does


use <g transform="scale(xxx)">, the png image looks good



GUI, it does get scaled properly. But image with scale()
transform attribute losses quality, and the png file


by Squiggle is in bad quality.

The problem is that you are asking to subsample the


too much. The large image is reduced by 5x the small by


Batik does not prefilter for large subsample values so you
'loose' pixels with subsample values this high and the


is aliasing effects.

   If anyone wants to write/contribute a block average or
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


team can also help.

Attache please find a svg file , a source png file and
png file.

Thanks a lot.


________________________________________________ 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

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

Reply via email to