Update 20241214
This commit is contained in:
@@ -68,7 +68,6 @@ namespace DOCGEN.Klassen
|
||||
}
|
||||
public string Generate_Word(string base64, clsDocData docdata)
|
||||
{
|
||||
|
||||
string formattype = "";
|
||||
MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64));
|
||||
WordDocument document = new WordDocument(ms, FormatType.Automatic);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -70,13 +70,13 @@ namespace DOCGEN
|
||||
return "";
|
||||
}
|
||||
|
||||
public string generate_serienbrief(string vorlage,serienbrief sb)
|
||||
public string generate_serienbrief(string vorlage,serienbrief sb, string dokumentid)
|
||||
{
|
||||
SyncFWord sfword = new SyncFWord();
|
||||
clsdok dok = new clsdok("", "", "");
|
||||
clsDocData dd = new clsDocData();
|
||||
dd.DocMacros = new List<clsDocMacro>();
|
||||
dd.Dokumentid = "";
|
||||
dd.Dokumentid = dokumentid;
|
||||
dd.DokumentDatum = sb.dokumentdatum.ToString();
|
||||
dd.Unterschrift_Links=sb.unterschriftlinks.ToString();
|
||||
dd.Unterschrift_Rechts = sb.unterschriftrechts.ToString();
|
||||
|
||||
@@ -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));
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user