update 20240925

This commit is contained in:
Stefan Hutter
2024-09-25 19:14:14 +02:00
parent d4b9318d96
commit 9fcecb2c35
324 changed files with 1886317 additions and 353 deletions

View File

@@ -111,8 +111,8 @@
<Compile Include="Klassen\DocGenerator_from_EDOKA.cs" />
<Compile Include="Klassen\SyncFPDF.cs" />
<Compile Include="Klassen\SyncFPowerPoint.cs" />
<Compile Include="Klassen\SyndFExcel.cs" />
<Compile Include="Klassen\SynFWord.cs" />
<Compile Include="Klassen\SyncFExcel.cs" />
<Compile Include="Klassen\SyncFWord.cs" />
<Compile Include="Print.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

View File

@@ -56,7 +56,7 @@ namespace DOCGEN.Generator
{
case "DOCX": case "DOCM": case "DOC": case "DOT":
case "WORD": case "DOTM":
SynFWord sfword = new SynFWord();
SyncFWord sfword = new SyncFWord();
generate_docdata(dokumentid, ref docdata);
clsdok dok = new clsdok("", "", "");
dok.dokument= sfword.Generate_Word(dt.Rows[0][0].ToString(), docdata);
@@ -65,7 +65,12 @@ namespace DOCGEN.Generator
//if (dok.extension.ToUpper()=="DOTM") { dok.extension = "docm"; }
return dok;
case "XLSM": case "XLSX": case "XLST": case "XLS": case "XLT":
SyncFExcel sfexcel = new SyncFExcel();
generate_docdata(dokumentid, ref docdata);
clsdok dokexcel = new clsdok("", "", "");
dokexcel.dokument = sfexcel.Generate_Excel(dt.Rows[0][0].ToString(), docdata);
dokexcel.doktype = "X";
dokexcel.extension = dt2.Rows[0][1].ToString();
return dokexcel;
//break;
case "PDF": case "ACROBAT": case "FORMULAR": case "DOKUMENT":

View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using Syncfusion.DocIO.DLS;
using Syncfusion.XlsIO;
namespace DOCGEN.Klassen
{
public class SyncFExcel
{
public bool create_nativ(string property, string value, string base64, string originalfile, string destfile)
{
FileStream ms = new FileStream(originalfile, FileMode.Open, FileAccess.Read);
FileStream os = new FileStream(destfile, FileMode.Create);
ExcelEngine ex = new ExcelEngine();
IApplication application = ex.Excel;
IWorkbook workbook = application.Workbooks.Open(ms);
try
{
workbook.CustomDocumentProperties[property].Text = value;
}
catch
{
workbook.CustomDocumentProperties.Remove(property);
workbook.CustomDocumentProperties[property].Text = value;
}
workbook.Replace("{" + property + "}", value);
//workbook.Names[workbook.CustomDocumentProperties[property].Name].RefersToRange.Text= workbook.CustomDocumentProperties[property].Text;
workbook.SaveAs(os);
workbook.Close();
workbook = null;
application = null;
ms.Close();
ms.Dispose();
os.Close();
os.Dispose();
return true;
}
public string Generate_Excel(string base64, clsDocData docdata)
{
ExcelEngine ex = new ExcelEngine();
IApplication app = ex.Excel;
MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64));
IWorkbook workBook = app.Workbooks.Open(ms, ExcelOpenType.Automatic);
string formattype = "";
foreach (clsDocValue dv in docdata.DocValues)
{
foreach (IWorksheet worksheet in workBook.Worksheets)
{
if (dv.FieldName== "TGEDKNameInhaber")
{
var a = 0;
}
try
{
worksheet.Range[dv.FieldName].Text = dv.Value.ToString();
}
catch { }
//foreach (IName name in worksheet.Names)
//{
// name.Value = dv.Value.ToString();
// Debug.Print(name.Value);
//}
}
}
MemoryStream destms = new MemoryStream();
workBook.SaveAs(destms);
workBook.Close();
workBook = null;
ex.Dispose();
byte[] imageArray = destms.ToArray();
if (docdata.Result_as_PDF == "True")
{
DocGet getdoc = new DocGet("");
string destdoc = "";
destdoc = getdoc.Convert_Word_To_PDF(Convert.ToBase64String(imageArray));
return destdoc;
}
return Convert.ToBase64String(imageArray);
}
}
}

View File

@@ -32,7 +32,7 @@ namespace DOCGEN.Klassen
}
try
{
ITextSelection[] textSelections = pptxDoc.FindAll(property, false, false);
ITextSelection[] textSelections = pptxDoc.FindAll("{"+property+"}", false, false);
foreach (ITextSelection textSelection in textSelections)
{
@@ -40,17 +40,6 @@ namespace DOCGEN.Klassen
textPart.Text = value;
}
// ITextSelection[] textSelection = pptxDoc.FindAll(property, false, false);
// foreach (ITextSelection textSelection in textSelections)
// {
// //Get the found text as a single text part.
// ITextPart textPart = textSelection.GetAsOneTextPart();
// //Replace the text.
// textPart.Text = value;
// }
//// ITextPart textPart = textSelection.GetAsOneTextPart();
// // textPart.Text = value;
}
catch { }

View File

@@ -35,7 +35,7 @@ using System.Security.Permissions;
namespace DOCGEN.Klassen
{
public class SynFWord
public class SyncFWord
{
public bool create_nativ(string property, string value, string base64, string originalfile, string destfile)
{
@@ -51,7 +51,7 @@ namespace DOCGEN.Klassen
}
TextSelection[] textSelections = document.FindAll("{Klassifizierung}", false, true);
TextSelection[] textSelections = document.FindAll("{" + property + "}", false, true);
foreach (TextSelection textSelection in textSelections)
{
//Gets the found text as single text range and sets highlight color
@@ -71,7 +71,7 @@ namespace DOCGEN.Klassen
string formattype = "";
MemoryStream ms = new MemoryStream(Helper.EncodeExtensions.DecodeBase642ByteArray(base64));
WordDocument document = new WordDocument(ms, FormatType.Doc);
WordDocument document = new WordDocument(ms, FormatType.Automatic);
formattype = document.ActualFormatType.ToString();
var formattype_original = document.ActualFormatType;

View File

@@ -1,45 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Syncfusion.XlsIO;
namespace DOCGEN.Klassen
{
public class SynFExcel
{
public bool create_nativ(string property, string value, string base64, string originalfile, string destfile)
{
FileStream ms = new FileStream(originalfile, FileMode.Open, FileAccess.Read);
FileStream os = new FileStream(destfile, FileMode.Create);
ExcelEngine ex = new ExcelEngine();
IApplication application = ex.Excel;
IWorkbook workbook = application.Workbooks.Open(ms);
try
{
workbook.CustomDocumentProperties[property].Text = value;
}
catch
{
workbook.CustomDocumentProperties.Remove(property);
workbook.CustomDocumentProperties[property].Text = value;
}
workbook.Replace("{Klassifizierung}", value);
//workbook.Names[workbook.CustomDocumentProperties[property].Name].RefersToRange.Text= workbook.CustomDocumentProperties[property].Text;
workbook.SaveAs(os);
workbook.Close();
workbook = null;
application = null;
ms.Close();
ms.Dispose();
os.Close();
os.Dispose();
return true;
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -4,7 +4,7 @@
<name>DOCGEN</name>
</assembly>
<members>
<member name="M:DOCGEN.Klassen.SynFWord.DocToPDF(System.String)">
<member name="M:DOCGEN.Klassen.SyncFWord.DocToPDF(System.String)">
<summary>Word to PDF-Konverter</summary>
<remarks>Das sind die Remarks</remarks>
<param name="dokument">Base64-Dokument</param>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -289,7 +289,7 @@ namespace DOCGEN
WordDocument[] words = new WordDocument[2];
WordDocument[] finalwords = new WordDocument[3];
bool splitted = false;
SynFWord sfword = new SynFWord();
SyncFWord sfword = new SyncFWord();
// Texte ersetzen
foreach (DataRow r in pdfparameters.Rows)
{
@@ -421,7 +421,7 @@ namespace DOCGEN
public void Print_Doc(string document)
{
SynFWord sfword = new SynFWord();
SyncFWord sfword = new SyncFWord();
sfword.Print_Word(document);
}

View File

@@ -126,3 +126,9 @@ E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\obj\Debug\DOCGEN.dll
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\obj\Debug\DOCGEN.pdb
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.Presentation.Base.dll
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\Syncfusion.Presentation.Base.xml
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\FastReport.dll
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\FastReport.Compat.dll
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\FastReport.Bars.dll
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\FastReport.DataVisualization.dll
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\FastReport.Editor.dll
E:\Software-Projekte\OnDoc\OnDoc\DOCGEN\bin\Debug\FastReport.xml

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
d14f2e223b0685966816e5b2aa5af46e3fc937f316941578832a83d0425adf5f
3f7140442142445ad7c9f4729d84022d6770a3c001af030551ccf3bd0d40bdd3