update 20250721
This commit is contained in:
@@ -61,7 +61,7 @@ namespace DOCGEN.Generator
|
||||
this.Office_Fill_DocIO = Office_Fill_DocIO;
|
||||
}
|
||||
|
||||
public clsdok Generate_Doc_EDOKA(string dokumentid, ref clsDocData docdata, bool useoffice = false, int OfficeSleep = 0, bool vbfilemanagement = false, bool editdoc = false)
|
||||
public clsdok Generate_Doc_EDOKA(string dokumentid, ref clsDocData docdata, bool useoffice = false, int OfficeSleep = 0, bool vbfilemanagement = false, bool editdoc = false, List<clsDocValue> APIValues=null)
|
||||
{
|
||||
if (docdata.Bezeichnung.Contains("QDF"))
|
||||
{
|
||||
|
||||
@@ -38,6 +38,7 @@ using static System.Net.Mime.MediaTypeNames;
|
||||
using System.Diagnostics;
|
||||
using Database;
|
||||
using System.Drawing.Drawing2D;
|
||||
using Syncfusion.Drawing;
|
||||
|
||||
|
||||
|
||||
@@ -228,6 +229,7 @@ namespace DOCGEN.Klassen
|
||||
}
|
||||
public string Generate_Word(string base64, clsDocData docdata, string img_UL = "", string img_UR = "", string img_faktura = "", bool serienbrief = false, bool editdoc = false)
|
||||
{
|
||||
|
||||
string formattype = "";
|
||||
MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64));
|
||||
WordDocument document = new WordDocument(ms, FormatType.Automatic);
|
||||
@@ -498,6 +500,18 @@ namespace DOCGEN.Klassen
|
||||
}
|
||||
|
||||
}
|
||||
try
|
||||
{
|
||||
foreach (attribute apivalue in docdata.APIValues)
|
||||
{
|
||||
BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document);
|
||||
bookmarkNavigator.MoveToBookmark(apivalue.Tag);
|
||||
//bookmarkNavigator.InsertText(dv.Value.ToString());
|
||||
bookmarkNavigator.ReplaceBookmarkContent(apivalue.Value, true);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
//gaga
|
||||
//if (docdata.As_Faksimile == "True" && serienbrief==true)
|
||||
//{
|
||||
@@ -538,6 +552,8 @@ namespace DOCGEN.Klassen
|
||||
{
|
||||
case "DOKUMENTSCHUETZEN":
|
||||
document.Protect(ProtectionType.AllowOnlyFormFields, "Australia");
|
||||
document.Protect(ProtectionType.AllowOnlyFormFields, "Australia");
|
||||
|
||||
break;
|
||||
case "FORMULARAKTUALISIEREN":
|
||||
if (document.ProtectionType != ProtectionType.NoProtection)
|
||||
@@ -654,6 +670,7 @@ namespace DOCGEN.Klassen
|
||||
|
||||
if (docdata.Result_as_PDF == "True")
|
||||
{
|
||||
DB dB = new DB();
|
||||
DocGet getdoc = new DocGet("");
|
||||
string destdoc = "";
|
||||
destdoc = getdoc.Convert_Word_To_PDF(Convert.ToBase64String(imageArray));
|
||||
@@ -1208,8 +1225,14 @@ namespace DOCGEN.Klassen
|
||||
{
|
||||
IWSection section = document.Sections[0];
|
||||
IWParagraph paragraph = section.HeadersFooters.Header.AddParagraph();
|
||||
System.Drawing.Image image = System.Drawing.Image.FromFile(@"E:\Software-Projekte\OnDoc\Images\tkb_logo_4c_u.jpg");
|
||||
paragraph.AppendPicture(image);
|
||||
|
||||
byte[] imageBytes = Convert.FromBase64String(get_image(4,-1,-1));
|
||||
using (var ms = new MemoryStream(imageBytes, 0, imageBytes.Length))
|
||||
{
|
||||
System.Drawing.Image image = System.Drawing.Image.FromStream(ms);
|
||||
paragraph.AppendPicture(image);
|
||||
}
|
||||
|
||||
|
||||
////Get the Word document section.
|
||||
//IWSection section = document.Sections[0];
|
||||
|
||||
Reference in New Issue
Block a user