File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes Doc to Pdf conversion using Java Code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Doc to Pdf conversion using Java Code" Watch "Doc to Pdf conversion using Java Code" New topic
Author

Doc to Pdf conversion using Java Code

Praveen Kumar Anekalmath
Greenhorn

Joined: Feb 26, 2007
Posts: 18
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.


Praveen
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8705
    
    6

Our Accessing File Formats FAQ has several options.
I've had good results using OpenOffice.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Praveen Kumar Anekalmath
Greenhorn

Joined: Feb 26, 2007
Posts: 18
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.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39542
    
  27
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.


Ping & DNS - updated with new look and Ping home screen widget
Praveen Kumar Anekalmath
Greenhorn

Joined: Feb 26, 2007
Posts: 18
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 ]
zett ucu
Greenhorn

Joined: Jan 15, 2009
Posts: 4
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/
 
 
subject: Doc to Pdf conversion using Java Code
 
Similar Threads
html:file
Convert PDF to RTF using itext
pdc viewer software needed
Convert PDF to RTF using itext
automate pdf creation from a html file on the web