OpenDocument4all - Info and tools about OpenDocument
Sunday, 05 February 2012
Home arrow Forum
Forum Statistics
Total user: 89
Total message: 179
Main Menu
Home
My Blog
AODL - Project
AODC - Project
OO Development & Info
Forum
About OpenDocument ...
Search
News
Contact Us
Login Form





Lost Password?
No account yet? Register
Sourceforge.net

SourceForge.net - Goto the project homepage
Project site on SF.net

 

Demand OpenDocument

 

Countomat Webcounter und Webstatistik (Statistik & Logfileanalyse, Counter)

OpenDocument4all-Forum

 
opening .wk1 file from c# using cli library
Date: 2010/03/29 21:12 By: sanjog sharma Status: User  
Karma: 0  
Fresh Boarder

Posts: 1
graphgraph
Hello,
I have been using open office.org cli libraries to print the documents directly from c#. Following is my code:
Code:

  public void PrintDoc(string sURL)         {             unoidl.com.sun.star.uno.XComponentContext localContext =         uno.util.Bootstrap.bootstrap();             unoidl.com.sun.star.lang.XMultiServiceFactory multiServiceFactory =                     (unoidl.com.sun.star.lang.XMultiServiceFactory)             localContext.getServiceManager();             //Create a new Desktop instance using our service manager             //Notice: We cast our desktop object to XComponent loader             //so that we could load or create new documents.             XComponentLoader componentLoader             =             (XComponentLoader)multiServiceFactory.createInstance(             "com.sun.star.frame.Desktop");             string sUrl PathConverter(sURL);             PropertyValue[] loadDesc = new PropertyValue[2];             // Setting the flag for hidding the open document             loadDesc[0] = new PropertyValue();             loadDesc[0].Name "Hidden";             loadDesc[0].Value = new uno.Any(true);                          loadDesc[1] = new PropertyValue();             loadDesc[1].Name "CharacterSet";             loadDesc[1].Value = new uno.Any(437);             // Loading the wanted document             XComponent xComp componentLoader.loadComponentFromURL             (sUrl"_blank"0loadDesc);                          PropertyValue[] printerProp = new PropertyValue[1];             printerProp[0] = new PropertyValue();             printerProp[0].Name "Name";             printerProp[0].Value = new uno.Any("PDFCreator");             XPrintable xPrintable = (XPrintable)xComp;             xPrintable.print(printerProp);         }


I need to print .wk1 files but xComponent object marked bold in above code returns null in case of .wk1 files only, whilst it works for other file types. Can anyone tell me what the problem and how can i open and print .wk1 files. Your help will be highly appreciated.
The administrator has disabled public write access.

Quick jump
Download area
Who's Online
We have 34 guests online
Polls
Should AODL and AODC also implement export as PDF and RTF?
 
Popular
© 2005 MamboZ. All rights reserved.