@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
public class FileConvertHelper
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ using System.Linq;
|
||||
using Spire.Doc;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
@@ -662,13 +663,23 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
MemoryStream wordMemoryStream = new MemoryStream();
|
||||
|
||||
Document document = new Document();
|
||||
|
||||
MiniSoftware.MiniWord.SaveAsByTemplate(wordMemoryStream, path, value);
|
||||
|
||||
document.LoadFromStream(wordMemoryStream, FileFormat.Docx);
|
||||
|
||||
document.SaveToFile(serverFilePath, FileFormat.PDF);
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
Document document = new Document();
|
||||
|
||||
document.LoadFromStream(wordMemoryStream, FileFormat.Docx);
|
||||
|
||||
document.SaveToFile(serverFilePath, FileFormat.PDF);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -691,10 +702,18 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
MiniSoftware.MiniWord.SaveAsByTemplate(memoryStream, path, value);
|
||||
Document document = new Document();
|
||||
|
||||
document.LoadFromStream(memoryStream, FileFormat.Docx);
|
||||
document.SaveToStream(pdfMemoryStream, FileFormat.PDF);
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
Document document = new Document();
|
||||
document.LoadFromStream(memoryStream, FileFormat.Docx);
|
||||
document.SaveToStream(pdfMemoryStream, FileFormat.PDF);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
pdfMemoryStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
|
||||
|
||||
Reference in New Issue
Block a user