Update 20241214
This commit is contained in:
@@ -24,6 +24,7 @@ using DOCGEN.Klassen;
|
||||
using System.Data;
|
||||
using Helper;
|
||||
using Syncfusion.XlsIO.Parser.Biff_Records;
|
||||
using System.Buffers.Text;
|
||||
|
||||
|
||||
namespace DOCGEN
|
||||
@@ -77,6 +78,33 @@ namespace DOCGEN
|
||||
return "";
|
||||
}
|
||||
|
||||
public string get_word_vorlage(int vorlagenr)
|
||||
{
|
||||
DB db = new DB(connectionstring);
|
||||
string sql = "Select dbo.BinaryToBase64(vorlage) as Data from office_vorlage_datei where office_vorlage_dateinr=" + vorlagenr;
|
||||
db.Get_Tabledata(sql, false, true);
|
||||
string base64 = db.dsdaten.Tables[0].Rows[0][0].ToString();
|
||||
MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64));
|
||||
WordDocument document = new WordDocument(ms, FormatType.Automatic);
|
||||
var formattype_original = document.ActualFormatType;
|
||||
MemoryStream destms = new MemoryStream();
|
||||
if (formattype_original.ToString().ToUpper() == "DOTMXXX")
|
||||
{
|
||||
document.Save(destms, FormatType.Docm);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
document.Save(destms, formattype_original);
|
||||
}
|
||||
|
||||
document.Close();
|
||||
document.Dispose();
|
||||
byte[] imageArray = destms.ToArray();
|
||||
ms.Close();
|
||||
ms.Dispose();
|
||||
return Convert.ToBase64String(imageArray);
|
||||
}
|
||||
public string Get_FileType(string b64)
|
||||
{
|
||||
var streamword = new MemoryStream(Convert.FromBase64String(b64));
|
||||
|
||||
Reference in New Issue
Block a user