• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doc to Pdf conversion using Java Code

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

I need to extract data from Doc to Pdf. How do i approach it? Is there any standard API for this.Please help.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Our Accessing File Formats FAQ has several options.
I've had good results using OpenOffice.
 
Praveen Kumar Anekalmath
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joe Ess,

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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is a "VM Template"?

If whatever you're doing can be done in OpenOffice, then you might be able to use the OpenOffice Java API to automate it.
 
Praveen Kumar Anekalmath
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Praveen Kumar Anekalmath wrote:Hi All

I need to extract data from Doc to Pdf. How do i approach it? Is there any standard API for this.Please help.




Try this page: http://www.dancrintea.ro/doc-to-pdf/
reply
    Bookmark Topic Watch Topic
  • New Topic