Hello all,
I want to convert .doc file to .pdf format using PortableOpenOffice that too programmatically. i.e. the file should get converted into pdf format on the fluy of c#.net code. I got one document from "codeproject" giving brief details to do this. Here is the link.
https://www.codeproject.com/KB/office/PortableOpenOffice.aspx
But I am getting problems in it. I have actually implemented everything from top to bottom of this page. But I am getting an exception at the c# code statement.
It will be very useful for me if someone throws more light on this. Its urgent!! Thanks in advance..
please, post your errors.
The Exception that I am getting is "The system cannot find the file specified"...I don't understand which file it is not getting. The file that I have given as a input file is perfectly alright. It is taking the path rightfully. So the doubt is whether the class is getting the path of portable office or not. I tried changing the value="OpenOfficePortable.exe" to value= fullpath in the web.config; but without success.
-- regards,
Mayuresh
In the article on CodeProject.com, the author points out several likely sources of error that could be your problem: 1.) long filenames (install OpenOffice Portable in a short path, best if directly off the root); 2.) OpenOffice should be in the installation folder of your application (so run it from the same short path where you install OpenOffice Portable); 3.) certain characters in path are rejected by OpenOffice Portable (so use only very common characters in it); 4.) for the example C# calling code to find your Basic macro that you create in OpenOffice Portable, to find OpenOffice Portable executable, etc. you need to correctly point your code to them (the author did it in an application configuration file with an appsettings section that he showed in the article, and you might have to modify that to fit your installation).
This is a product made by PortableApps.com
But OpenOffice.org, Portable or not, can convert a .doc to .pdf
Just open the .doc file in OpenOffice.org and export it to .pdf
I want to do it programmatically. As I mentioned; I want to write a c# code where Input and output filenames would be the strings given and the file will get converted into pdf format on the fly of this code...I want this to work in a web application on a server....
-- regards,
Mayuresh
The .NET code I've seen that instantiates OpenOffice.org to do things requires a LOCAL install of OpenOffice.org that is registered on the PC. OpenOffice.org Portable is not registered and, thus, does not have the appropriate objects available for .NET. Your best bet is to install OpenOffice.org and then instantiate it using the code available. If you're on a shared host where you can't install it, you may be out of luck.
Sometimes, the impossible can become possible, if you're awesome!
I have OpenOffice.org as well installed on my machine alongwith OpenOfficePortable.
-- regards,
Mayuresh