[Solved] storeToUrl failing silently

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
zoharat
Posts: 18
Joined: Tue Dec 02, 2008 7:19 pm

[Solved] storeToUrl failing silently

Post by zoharat »

In our web application we are trying to convert office document e.g doc, xls, ppt to PDF files.

Now we have multiple requests being sent to a doConvert method.

I synchronize all the calls so that only only thread makes a call to open office at a time

if I have 10 files 8 will render fine and 2 (maybe more) will fail. But no error is thrown.

I use the storeToUrl method.

the arugment I supply are the sSaveUrl which is the path to PDF file.

SaveArgs are the filter type and the overwrite equals true and use the following method call.

storeToURL(sSaveUrl, saveArgs);

Has anyone ever faced this issue. I am using Windows XP and OpenOffice 3.0.

I use the bootstrapConnector to connect to Open Office.
Last edited by Hagar Delest on Sat Dec 27, 2008 12:35 am, edited 1 time in total.
Reason: tagged [Solved].
OOo 3.0.X on Ms Windows XP + Red Hat Linux
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: storeToUrl failing silently

Post by Villeroy »

Your question is impossible to answer. You may find the answer by simply debugging your program.
A tool that has been reported as working reliably:
http://www.oooninja.com/2008/02/batch-c ... -with.html
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
zoharat
Posts: 18
Joined: Tue Dec 02, 2008 7:19 pm

Re: storeToUrl failing silently

Post by zoharat »

I debugged the code. The application simply calls the storeToUrl and then goes on, no error is logged.

I noticed something else happening, lets say I have 2 files

The first one does not get converted, no error is thrown.

When the next one is about to be converted it gets the pdf file of the first document.

Its almost as if the socket is not getting cleared or something.

I cannot use the command line utility. I need to make the call for conversion through Java directly.
OOo 3.0.X on Ms Windows XP + Red Hat Linux
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: storeToUrl failing silently

Post by Villeroy »

Quick test in Basic:

Code: Select all

thiscomponent.storeToURL("file:///tmp/test.xyz", Array(1,2,3))
Error "Variable not set". I believe it means the missing property values.

Code: Select all

thiscomponent.storeToURL("/tmp/test.xyz", Array())
Basic I/O exception due to non-URL

Code: Select all

thiscomponent.storeToURL("file:///tmp/test.xyz", Array())
Stores to URL without special options (empty array).

It does not fail silently.

I moved this from "General" to "API"
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
zoharat
Posts: 18
Joined: Tue Dec 02, 2008 7:19 pm

Re: storeToUrl failing silently

Post by zoharat »

Does the call storeToUrl block until the file is written out to required location?

At this point my results show that I get the pdf correct for some and for others its almost as if pdf conversion for one which did not complete is being written out when a new request is being made.
OOo 3.0.X on Ms Windows XP + Red Hat Linux
zoharat
Posts: 18
Joined: Tue Dec 02, 2008 7:19 pm

Re: storeToUrl failing silently

Post by zoharat »

On further debugging I discovered, my code was not right.

So I fixed my threading issues and it works fine now.
OOo 3.0.X on Ms Windows XP + Red Hat Linux
Post Reply