Layout from AWT Renderer differs considerably from PDF renderer: letter spacing is different, line heights are different. As I understand it, the AWT renderer retrieves font metrics from java.awt.Font. The PDF renderer uses metrics files that were generated with TTFReader (from the very same TrueType fonts). I expect that both methods produce the same result, but they don't !? It should be possible to use EXACTLY the same metrics info for the AWT Renderer.
This is NOT a bug. FOP is working as designed, and yes there are differences between AWT and PDF. What about text output, that is very different from PDF, but the difference is not a bug, because the differences are to be expected. The same is true for AWT. What we could and should change is the website to explain what users can expect from AWT, here: http://xml.apache.org/fop/output.html#awt
I see what you mean. My problem is this: I would like to include a preview dialog in my application, and it's very unfortunate when the preview looks different than the resulting PDF. I would suggest that you either: * make metrics files available for AWTRenderer or * make sure that these metrics files are identical to the AWT font metrics Regards, Peter
We do not plan to change AWT renderer to use font metrics, because then AWT becomes something else. The way to preview and then print is to generate PDF and postscript in a servlet, display the PDF to the user (via HTTP) and send your Postscript to the printer. The Postscript and PDF Renderers are designed to generate the same output. If you find that this is not the case then it is a bug.
If you need a preview, you could have a look at Multivalent (http://http.cs.berkeley.edu/~phelps/Multivalent/) which (I think) has a PDF viewer in Java under a BSD-style license. I haven't used it so I can't say anything about its quality. Another possibility may be to use Eclipse.org's SWT which enables you to display Acrobat Reader inside your application just as IE and Mozilla and friends can. I heard that it's now possible to use Swing inside SWT. Awkward but maybe it helps. Just a couple of ideas...
Thanks !! Multivalent looks really interesting.
batch transition to closed remaining pre-FOP1.0 resolved bugs