Jon A. Cruz wrote:
On Sep 27, 2005, at 7:51 AM, John Taber wrote:
Is it that hard to translate the java to c++ ? Shouldn't be, though I've learned nothing in software is trivial.
Actually, it should.
There's enough fundamental difference to the languages and libraries that anything non-trivial can't just be translated.
Instead it would need to be re-implemented.
I don't see the problem here at all. Calling out to the Java VM is no harder than calling out to Perl or Python. In fact, Java's C API is actually a lot cleaner than those (especially that awful Perl crappy API).
Give FOP a try in generating PDF's. You will be pleasantly surprised. Try the following test... Save this file as 'master.fo'. Change the svg file name to the desired name:
<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format%22%3E
<fo:simple-page-master master-name="page"
page-height="297mm" page-width="210mm"
margin-top="20mm" margin-bottom="10mm"
margin-left="25mm" margin-right="25mm">
<fo:region-body margin-top="0mm" margin-bottom="15mm"
margin-left="0mm" margin-right="0mm"/>
<fo:region-after extent="10mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="page">
<fo:flow flow-name="xsl-region-body">
<fo:external-graphic src="tux.svg"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
Run this command in the FOP distro dir: sh fop.sh master.fo -pdf output.pdf or on Windows: fop master.fo -pdf output.pdf
...then check it out with Acroreader, and you will see some very good output. Note the fine-grained formatting control one gets with XSL-FO. Also note that the SVG can also be inlined, allowing us the possibility of having another output type.
One can even use FOP to configure a printer server to be able to handle XSL-FO natively. Very nice.
Bob
An aside note: Some people have an irrational Java-phobia. More like a language racism. If it works, it works, whatever the paradigm. Any worthwhile programmer should use every available tool in the toolkit, and not limit himself to any single mode. All of those "X is better than Y" arguments are silly and childish. ;-)