loadComponentFromURL resulting in null document

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
zoharat
Posts: 18
Joined: Tue Dec 02, 2008 7:19 pm

loadComponentFromURL resulting in null document

Post by zoharat »

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.

Thanks!
Attachments
2393086.doc
Document which gets loaded as a null document
(1.87 KiB) Downloaded 320 times
OOo 3.0.X on Ms Windows XP + Red Hat Linux
User avatar
MrProgrammer
Moderator
Posts: 5430
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: loadComponentFromURL resulting in null document

Post by MrProgrammer »

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, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Post Reply