loadComponentFromURL resulting in null document

Java, C++, C#, Delphi, ??? - Using the UNO bridges

loadComponentFromURL resulting in null document

Postby zoharat » Thu Jul 28, 2011 5:49 pm

We have successfully connected to Open Office amd are using it to convert word documents to pdf files.

This works fine for most word documents.

For the attached word document the loadCompoenetFromURL results in a null document.

How do I debug why the resulting document is null? Do I need to pass in additional propperties so that the document gets loaded.

Any help in this regard will greatly help.

Document which gets loaded as a null document
(1.87 KiB) Downloaded 185 times
OOo 3.0.X on Ms Windows XP + Red Hat Linux
Posts: 18
Joined: Tue Dec 02, 2008 7:19 pm

Re: loadComponentFromURL resulting in null document

Postby MrProgrammer » Thu Jul 28, 2011 7:05 pm

Your "doc" file is a simple ASCII text document and not a Word document. It has the wrong extension — should be "txt" instead of "doc". In Windows try opening it with Notepad and compare that with opening a real Word document in Notepad. In Linux, use the "cat" command to display the file. If you want your program to be able to handle situaitons like this (wrong file extension) you'll probably need to have it inspect the file for Word's "signature" (I don't know what that is) before using OOo to open it as if it were a Word document.
 Edit: Even better for Linux, use one of these to display the beginning of the file:
  • head -2 2393086.doc | od -t c
  • head -2 2393086.doc | od -t x1
(I don't have Linux, but I think these commands will work there.) 
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
Posts: 3952
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Return to External Programs

Who is online

Users browsing this forum: No registered users and 2 guests