PDF file is not creating from word document in Windows Server IIS

I am wrting a c# code which is perfectly running in my local developemt server, when i deploying the same application in windows Server 2016 the libreOffice not create pdf file from word doc. I am pasting my code for reference.

  string fileName = Path.GetFileName(wordFilePath);
  string fileDir = Path.GetDirectoryName(outputPdfPath);
  string str = "This is the \"String\" class.";
  string outputDir = "\"E:\\Temp Cover Note\\Templates\"";
  var pdfProcess = new Process();
  pdfProcess.StartInfo.FileName = @"C:\Program Files (x86)\LibreOffice\program\soffice.com";
  log.Info("\"C:\\Program Files (x86)\\LibreOffice\\program\\soffice.com\" --headless --convert-to pdf \"E:\\Temp Cover Note\\Templates\\" + CoverNotId + ".docx\"   --outdir "+ outputDir);
  pdfProcess.StartInfo.Arguments = "\"C:\\Program Files (x86)\\LibreOffice\\program\\soffice.com\" --headless --convert-to pdf \"E:\\Temp Cover Note\\Templates\\" + CoverNotId + ".docx\"   --outdir " + outputDir;
  //String.Format("--norestore --nofirststartwizard --headless --convert-to pdf  \"{0}\"", fileName);
  pdfProcess.StartInfo.WorkingDirectory = fileDir;
  
  pdfProcess.StartInfo.RedirectStandardOutput = true;
  pdfProcess.StartInfo.RedirectStandardError = true;
  pdfProcess.StartInfo.UseShellExecute = false;
 
  pdfProcess.Start();

  string output = pdfProcess.StandardOutput.ReadToEnd();
  string error = pdfProcess.StandardError.ReadToEnd();

… and the resulting content of string output and string error is … ? :slight_smile:

No output.
No Error.

Basically it haults the process. I need to kill manually from task manager.

Is this for any doc, or maybe for some specific one?

for word document.

Is this for any word document, or maybe for some specific one?

For Word Document.

Is this for any Word Document, or maybe for some specific one?

Or how else should I ask, if there are documents (Word’s .DOC) that succeed? If there are other types of the documents that also succeed, you could feel free to also tell that. And generally, if you think that it’s OK to persuade you to share any information to try to help you, you are mistaken.

basically the flow of application is,
there is a one word document template, which is modified on run time and save new word document. after saving need to convert that document in pdf format and sent it back to client via http call.

the above scenario is working fine in my development enviroment. when i deployed this application word document created but LibreOffice is not converting that document to PDF. and it haults the process. i am pasting the application logs for better understanding.

2024-08-16 17:18:50,036 [6] INFO TempCoverNote_Api.Service.TempCoverNoteServices - Started Generating Covernote
2024-08-16 17:18:52,042 [6] INFO TempCoverNote_Api.Service.TempCoverNoteServices - Started Generating Covernote
2024-08-16 17:18:52,042 [6] INFO TempCoverNote_Api.Service.TempCoverNoteServices - “C:\Program Files (x86)\LibreOffice\program\soffice.com” --headless --convert-to pdf “E:\Temp Cover Note\Templates\000169.docx” --outdir “E:\Temp Cover Note\Templates”
2024-08-16 17:18:52,042 [6] INFO TempCoverNote_Api.Service.TempCoverNoteServices - starting the Process
2024-08-16 17:18:52,101 [6] INFO TempCoverNote_Api.Service.TempCoverNoteServices - Process started
2024-08-16 17:18:52,101 [6] INFO TempCoverNote_Api.Service.TempCoverNoteServices - Wait for Exit the Process