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];
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -32,6 +32,7 @@ namespace DOCGEN
|
||||
public edoka_dms.clsConnectionProvider conn_edoka = new edoka_dms.clsConnectionProvider();
|
||||
private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger();
|
||||
public string DokumentID = "";
|
||||
private string startupdir = "";
|
||||
public string connectionstring = "";
|
||||
public clsDocData DocData = new clsDocData();
|
||||
DB db = new DB();
|
||||
@@ -155,6 +156,7 @@ namespace DOCGEN
|
||||
System.Drawing.Image barcode = sfword.Get_Barcodeimage(dd);
|
||||
|
||||
var stream = new MemoryStream(Convert.FromBase64String(pdfdoc));
|
||||
|
||||
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(stream);
|
||||
PdfBitmap image = new PdfBitmap(barcode);
|
||||
for (int i = 0; i < loadedDocument.Pages.Count; i++)
|
||||
|
||||
@@ -348,8 +348,10 @@ namespace DOCGEN
|
||||
//Dokument erstellen
|
||||
var streamword = new MemoryStream(Convert.FromBase64String(document));
|
||||
WordDocument wordDocument = new WordDocument(streamword, Syncfusion.DocIO.FormatType.Automatic);
|
||||
wordDocument.Properties.Hyphenation.AutoHyphenation = true;
|
||||
//FileStream dictornyrystream = new FileStream(@"E:\Software-Projekte\OnDoc\OnDoc\Client\bin\Debug\hyph_de_CH.dic", FileMode.Open);
|
||||
//Hyphenator.Dictionaries.Add("de-CH", dictornyrystream);
|
||||
|
||||
|
||||
|
||||
// Keine Parameter / Dokument als PDF konvertieren
|
||||
if (pdfparameters == null)
|
||||
@@ -380,6 +382,7 @@ namespace DOCGEN
|
||||
pdfDocument.Save(outputStream);
|
||||
byte[] bytes;
|
||||
bytes = outputStream.ToArray();
|
||||
//dictornyrystream.Close();
|
||||
return Convert.ToBase64String(bytes);
|
||||
}
|
||||
};
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user