Ask Your Question

Not able to launch soffice within an application on the iis server

asked 2019-02-06 14:52:57 +0100

BinoyCherian gravatar image

Hi Team,

I have an c# application which calls the soffice. The code works perfectly on the IISExpress server on my local machine but it's the test server that fails and I couldn't identify the problem. But there is a similar question on stackoverflow as shared below

As peer the analysis by an another developer, libreoffice accesses the folder location C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\LibreOffice and he proceeds to provide access to this folder for his profile on the server.

I wanted to check with you guys if this is really the issue and if there was a method possible to run the application programmatically on the iis test server without folder permissions. As per a team member, folder permissions on the server has to be avoided.

Please let me know if you need any other information.

Regards, Binoy

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-02-06 15:15:25 +0100

LibreOffice reads and writes to its user profile (not the same that Windows user profile!); by default, it's under %appdata%\LibreOffice\4.

But this is configurable, e.g., at launch using -env command line parameter.

edit flag offensive delete link more


Hello @Mike, I tried your suggestion with the string "-env:UserInstallation=C:\test\NPP\ --headless --convert-to pdf \"C:\Conversion\_DEV_DCHI\17\20190204-110617-402-XFEVJ3Z9BG\Lorem Ipsum.docx\" --outdir C:\Conversion\_DEV_DCHI\17\20190204-110617-402-XFEVJ3Z9BG\PDF" and i see the soffice gets launched but it doesn't convert and runs continously in the background. Am I doing something wrong.

BinoyCherian gravatar imageBinoyCherian ( 2019-02-11 13:53:32 +0100 )edit
  1. -env:UserInstallation only accepts file: URLs, as shown in the help.
  2. What are those escaped quotes in the Lorem Ipsum.docx?
Mike Kaganski gravatar imageMike Kaganski ( 2019-02-11 14:07:26 +0100 )edit

@Mike, Those quotes are to handle spaces in the filename or directory. I tried passing a file this time -env:UserInstallation=C:\test\NPP\test --headless --convert-to pdf C:\Conversion\_DEV_DCHI\17\20190204-110617-402-XFEVJ3Z9BG\Lorem Ipsum.docx --outdir C:\Conversion\_DEV_DCHI\17\20190204-110617-402-XFEVJ3Z9BG\PDF. Still the same, the control jumps out of the loop and keeps running in the background when I debug, I am manually killing the process from the task manager.

BinoyCherian gravatar imageBinoyCherian ( 2019-02-11 14:25:25 +0100 )edit

I seem to be not listened... I told you that you need to pass URLs, not paths to -env:UserInstallation - I got ignored. I asked why those quotes are escaped - I got ignored...

And btw, writing @ Mike unnecessarily pings not me, but completely other person. My nick is @Mike Kaganski.

Mike Kaganski gravatar imageMike Kaganski ( 2019-02-11 14:28:49 +0100 )edit

@Mike, I didn't ignore you at all, you have been helping me a lot :). I need to escape those quotes, I might have written my previous comment wrongly. I need to escape the quotes to allow spaces in the file and directory name. As for the second, question. I don't understand the concept of URL's to pass it to libreoffice(an http url?), I checked a similar question on stackoverflow and this is the link below, but didn't help me, I don't mean any offense, but could you help me with an example easy to understand than the one in the help

BinoyCherian gravatar imageBinoyCherian ( 2019-02-11 14:38:39 +0100 )edit

I suppose that you should have started with a command line like

soffice -env:UserInstallation=file:///C:/test/NPP --headless --convert-to pdf "C:\Conversion\_DEV_DCHI\17\20190204-110617-402-XFEVJ3Z9BG\Lorem Ipsum.docx" --outdir C:\Conversion\_DEV_DCHI\17\20190204-110617-402-XFEVJ3Z9BG\PDF

where the profile directory is given as file:///C:/test/NPP file: URL, and Lorem Ipsum.docx uses unescaped quotes.

Also you could try current daily 6.3 builds in case it doesn't work, to have proper console output - in case the program actually tries to inform you about a problem, but tdf#112536 prevents it. Using that daily temporarily in the debugging stage could help you nail down the problem, and then return to a stable version.

Mike Kaganski gravatar imageMike Kaganski ( 2019-02-11 14:47:02 +0100 )edit

@Mike, Thanks, it worked like a charm on my test server. I see what I was doing wrong, I saw the word "file" and imagined it wrongly that libreoffice stocks all settings in the file we specify. But all is good now. Thanks again

BinoyCherian gravatar imageBinoyCherian ( 2019-02-11 15:30:55 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-02-06 14:52:57 +0100

Seen: 17 times

Last updated: Feb 06