Hi All, Angelo zerr is working on ODT 2 XHTML via ODFDOM and ODT 2 PDF via ITEXT+ODFDOM. He is willing to contribute his code back to ODF Toolkit. Thanks Angelo zerr. This is a good thing, as lots of users hope ODF Toolkit can supply some convertors to do odf->html, odf -> pdf, etc.
Any guys interested in his work? Or can supply help on the layout issue? ---------- Forwarded message ---------- From: Angelo zerr <[email protected]> Date: 2011/11/5 Subject: Create new FOP project to create PDF document with Java code (not with XSL-FO). To: [email protected], [email protected], Devin Han <[email protected]>, Pascal Leclercq <[email protected]> Hi, At first I introduce to me. I'm XDocReport http://code.google.com/p/xdocreport/ commiter. This project gives you the capability to create model with OpenOffice (odt) or MS word (docx) with Freemarker, Velocity syntax and generate report (odt 2 odt, docx 2 docx) But it's possible too to convert it the generated report to another format like PDF, XHTML.... We have implemented several ODT and Docx converter (ODT 2 PDF via FOP (with XSL-FO)..), ODT 2 PDF via IText by using ODFDOM, Docx 2 PDF via IText by using HWPF POI). There is onlide demo of XDocReport. For instance 1) Convert ODT 2 XHTML via ODFDOM : please see at http://xdocreport.opensagres.cloudbees.net/processReport?reportId=ODTBi g.odt&dispatch=load&converter=XHTML_ODFDOM<http://xdocreport.opensagres.cloudbees.net/processReport?reportId=ODTBig.odt&dispatch=load&converter=XHTML_ODFDOM> 2) Convert ODT 2 PDF via ITEXT+ODFDOM : please see at http://xdocreport.opensagres.cloudbees.net/processReport?reportId=ODTBi g.odt&dispatch=load&converter=PDF_ITEXT<http://xdocreport.opensagres.cloudbees.net/processReport?reportId=ODTBig.odt&dispatch=load&converter=PDF_ITEXT>(render is very bad, I'm working about that). I would like give my code to Apache but the big problem is the iText license. We are using iText, because you can create a PDF with Java model, that is more easy than XSL-FO. I have already done odt -> xslt -> FO -> FOP -> PDF and docx -> xslt -> FO -> FOP -> PDF but developing XSL is very awfull compared to developing Java code. More in the case of docx and odt, styles must be computed and even with xsl:key, performance are not very good. So I'm searching a solution like iText to create PDF with Java code. After several discussion in the PDFBox forum with Jeremias Maerki, he tell me that it's possible to create PDF with FOP with Java code http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleJava2D2PDF.java?view=markup The only problem is layout management. My idea is to create a new project based on FOP to create PDF with Java code (by managing layout) like iText. Ex: ----------------------------- StructuredDocument document = new StructuredDocument(); Paragraph paragraph = new Paragraph(); paragraph.setBackgroundColor(Color.RED); paragraph.addRun(new Run("AAAA")); document.addElement(paragraph); paragraph = new Paragraph(); paragraph.addRun(new Run("AAAA")); paragraph.addRun(new Run("BBBB")); document.addElement(paragraph); ------------------------ After that, we could use this API to convert docx ->PDF like this docx -> HWPF POI -> FOP Java code -> PDF and odt ->PDF like this odt -> ODFDOM -> FOP Java code -> PDF. Are you interested to help us to create this project? Devin Han who is one of lead (I believe) of ODF Toolkit is very interested to have ODT -> PDF converter and he wants to contribute to this project. For the layout, I'm not an expert but I have discovered that Java provides some layout like java.awt.font.TextLayout. Do you think it's a good idea to use it? Or do yout think it's better to create our own layout manager? Thank a lot for your answer. Regards Angelo -- -Devin
