I tried using Open Office as Doc to Pdf convertor and its working fine. But in my application the requirement is to genearate doc file using VM templating and it is happening. But i want to generate PDF using VM template. Is this possible to approach? Please suggest.
Hi Ulf Dittmer, Thanks for the reply.This is my requirement : The records coming from the database has to be shown in table along with header and footer in Doc. To approach this, i have used org.apache.velocity.Template; org.apache.velocity.VelocityContext; org.apache.velocity.app.VelocityEngine; Using this template it is successfully generating Doc. But i need to generate Pdf along with this Doc. I tried OpenOffice Api to convert Doc to Pdf, but it is not able to recognize the Doc file that is generated by Velocity Engine.When i take any other Doc other than generated from VM its converting into Pdf without any problem. Even i tried Apache POI to read the Doc file, its throwing error :java.io.IOException: Invalid header signature; read 7311066695147732796, expected -2226271756974174256 I opened the Doc generated from VM in Editplus and it look like this :
Is there any problem in this doc? Please help how can i read this from either OpenOffice or Apache POI?
[Edited by Jaikiran to enclose the xml in Code tags] [ July 08, 2008: Message edited by: Jaikiran Pai ]