c# - LibreOffice Convert XLSX to PDF in ASP.NET MVC -
version 4.3
in c# trying utilize headless alternative convert xlsx pdf nil happens when run asp.net or simple command prompt.
var pdfprocess = new process(); pdfprocess.startinfo.filename = exe; pdfprocess.startinfo.arguments = param + " \"" + fulldocpath +"\""; pdfprocess.start();
where exe , params are:
c:\program files (x86)\libreoffice 4\program\soffice.exe -norestore -nofirststartwizard -nologo -headless -convert-to pdf "c:\uds_docs\temp\teller roster national.xlsx"
i used gui test libreoffice can convert file , worked fine.
here how convert excel, word etc pdf on asp.net mvc web site @ no cost:
install libreoffice, free
set current directory same folder existing xls. seems missing piece.
run this:
"c:\program files (x86)\libreoffice 4\program\soffice.exe" -norestore -nofirststartwizard -headless -convert-to pdf "thefile.xlsx"
in c#:
var pdfprocess = new process(); pdfprocess.startinfo.filename = exepdf; pdfprocess.startinfo.arguments = "-norestore -nofirststartwizard -headless -convert-to pdf \"thefile.xlsx\""; pdfprocess.startinfo.workingdirectory = docpath; //this of import pdfprocess.start();
make sure workerprocess has access exe, default not.
c# asp.net-mvc pdf libreoffice
No comments:
Post a Comment