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

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

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.

Hello @Mike2, 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.

  1. -env:UserInstallation only accepts file: URLs, as shown in the help.
  2. What are those escaped quotes in the Lorem Ipsum.docx?

@Mike2, 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.

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 @mikekaganski.

@Mike2, 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

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.

1 Like

@Mike2, 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