OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Print Word Document

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
pallavi_lodaya
General User
General User


Joined: 03 Feb 2005
Posts: 9

PostPosted: Thu Feb 03, 2005 10:53 pm    Post subject: Print Word Document Reply with quote

Hi,

I need help for printing a word doc.
Can I print a word document OpenOffice from my JAVA Program?

Thanks and Regards,
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Thu Feb 03, 2005 11:23 pm    Post subject: Re: Print Word Document Reply with quote

pallavi_lodaya wrote:
I need help for printing a word doc.
Can I print a word document OpenOffice from my JAVA Program?

Yes. Take a look at the OOo Dev Guide: http://api.openoffice.org/docs/DevelopersGuide/DevelopersGuide.htm

Especially Chapter "2.3.3 Configuration" http://api.openoffice.org/docs/DevelopersGuide/FirstSteps/FirstSteps.htm#1+3+3+Configuration to make your OpenOffice.org listen to your Java application, and Chapter "7.2 Handling Text Document Files" http://api.openoffice.org/docs/DevelopersGuide/Text/Text.htm#1+2+Handling+Text+Document+Files" to handle loading and printing of documents.

With kind regards
hol.sten
Back to top
View user's profile Send private message
pallavi_lodaya
General User
General User


Joined: 03 Feb 2005
Posts: 9

PostPosted: Fri Feb 04, 2005 1:05 am    Post subject: Reply with quote

Hi Sten,
Thanks for your reply.
When I installed OpenOffice1.1.4 I got all these folders:
help
Program
Share
user

But in First Steps chapter api docs path is given as docs/common/ref

I am not able to locate that folder.

Can you help me for the same?

Thanks in Advance,
Pallavi Lodaya
Back to top
View user's profile Send private message
pallavi_lodaya
General User
General User


Joined: 03 Feb 2005
Posts: 9

PostPosted: Fri Feb 04, 2005 1:26 am    Post subject: Print Word Document Reply with quote

Hi,

I tried the program given in docs for connecting to OpenOffice.
It works fine.
But can u help me or redirect me to APIs required for opening a word doc and printing the doc.

Thanks and Regards,
Pallavi Lodaya
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Fri Feb 04, 2005 1:29 am    Post subject: Reply with quote

pallavi_lodaya wrote:
But in First Steps chapter api docs path is given as docs/common/ref

Please, read more carefully Wink

First Steps wrote:
2.3.1 Required Files

These files are required for any of the languages you use.

OpenOffice.org Installation
....

API Reference

The OpenOffice.org API reference is part of the Software Development Kit and provides detailed information about OpenOffice.org objects. The latest version can be downloaded from the documents section at api.openoffice.org.

Go to http://api.openoffice.org/SDK/index.html

With kind regards
hol.sten
Back to top
View user's profile Send private message
pallavi_lodaya
General User
General User


Joined: 03 Feb 2005
Posts: 9

PostPosted: Fri Feb 04, 2005 3:28 am    Post subject: Reply with quote

HI Sten,

Sorry but I did not get u. I think this path is for including the APIs or JAVA Docs.
Anyways, after getting the XMultiComponentFactory object when I added the code:

Object desktop = xRemoteServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop",xRemoteContext);

XComponentLoader xcomponentLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class,desktop);

String stringUrl = "file:///" + file.getAbsolutePath().replace('\\', '/');
PropertyValue[] propertyvalue = new PropertyValue[1];
propertyvalue[0] = new PropertyValue();
propertyvalue[0].Name = "Hidden";
propertyvalue[0].Value = new Boolean(true);

XComponent doc = xcomponentLoader.loadComponentFromURL(stringUrl, "_blank", 0, propertyvalue);

XTextDocument xTD = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, doc);
System.out.println(xTD.getURL());


I get NullpointerException.
Since I am not able to see the JAVADocs also I am not able to fine the problem,

Thanks in advance,
Pallavi Lodaya
Back to top
View user's profile Send private message
pallavi_lodaya
General User
General User


Joined: 03 Feb 2005
Posts: 9

PostPosted: Fri Feb 04, 2005 6:16 am    Post subject: Print Word Document Reply with quote

Hi Sten,

Thanks for your help. I could print the documents form OpenOffice.

Thanks and Regards,
Pallavi Lodaya
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Fri Feb 04, 2005 7:43 am    Post subject: Re: Print Word Document Reply with quote

pallavi_lodaya wrote:
I could print the documents form OpenOffice.

Well done. And enjoy the OOo Dev Guide further on. It really solves a lot of problems Smile

With kind regards
hol.sten
Back to top
View user's profile Send private message
pallavi_lodaya
General User
General User


Joined: 03 Feb 2005
Posts: 9

PostPosted: Sun Feb 06, 2005 10:12 pm    Post subject: Print Word Document Reply with quote

Hi Sten,

Can you tell me whether OpenOffice will work on AIX Unix or not?

Thanks,
Pallavi
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Sun Feb 06, 2005 11:44 pm    Post subject: Re: Print Word Document Reply with quote

pallavi_lodaya wrote:
Can you tell me whether OpenOffice will work on AIX Unix or not?

I haven't tried it yet so I cannot give you a reliable answer. I'm only familiar with Windows XP, Linux, and Solaris.

With kind regards
hol.sten
Back to top
View user's profile Send private message
pallavi_lodaya
General User
General User


Joined: 03 Feb 2005
Posts: 9

PostPosted: Sun Feb 06, 2005 11:48 pm    Post subject: Print Word Document Reply with quote

Sten,

Can you just tell me which downloadable version should I take if I want to install OpenOffice on AIX UNIX?

Thanks,
Pallavi
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Sun Feb 06, 2005 11:51 pm    Post subject: Re: Print Word Document Reply with quote

pallavi_lodaya wrote:
Can you just tell me which downloadable version should I take if I want to install OpenOffice on AIX UNIX?

No

Regards
hol.sten
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group