update 0250704

This commit is contained in:
Stefan Hutter
2025-07-04 21:40:19 +02:00
parent 6763534b8c
commit 68e4725ff5
71 changed files with 483 additions and 93 deletions

View File

@@ -27,6 +27,7 @@ using Helper;
using Syncfusion.XlsIO.Parser.Biff_Records;
using System.Buffers.Text;
using Syncfusion.ExcelToPdfConverter;
using OnDocOffice;
namespace DOCGEN
@@ -151,7 +152,7 @@ namespace DOCGEN
db.Get_Tabledata("select * from Relaunch_View_PDF_Parameter where dokumentid='" + DocID + "' order by sort", false, true);
return GetDocAsPDF(DocID, db.dsdaten.Tables[0]);
}
public clsdok GetDocAsPDF(string Docid, DataTable pdfparameters = null)
public clsdok GetDocAsPDF(string Docid, DataTable pdfparameters = null,string tempdir="", bool schnellansicht = false)
{
clsdok dok = GetDoc(Docid);
@@ -160,6 +161,36 @@ namespace DOCGEN
switch (dok.doktype.ToUpper().Substring(0, 1))
{
case "D":
if (schnellansicht)
{
dok.dokument = Convert_Word_To_PDF(dok.dokument.ToString(), pdfparameters);
dok.extension = "pdf";
return dok;
}
DB db1 = new DB(connectionstring);
string SQL = "SELECT dbo.dokumenttyp.ErstellungInOffice FROM dbo.dokument INNER JOIN dbo.dokumenttyp ON dbo.dokument.dokumenttypnr = dbo.dokumenttyp.dokumenttypnr where dbo.dokument.dokumentid=@dokumentid";
db1.clear_parameter();
db1.add_parameter("@dokumentid", Docid);
db1.Get_Tabledata_Addvar(SQL, false, true);
try
{
if (Convert.ToBoolean(db1.dsdaten.Tables[0].Rows[0]["Erstellunginoffice"]))
{
OnDocOffice.OfficeToPDF officeToPDF = new OnDocOffice.OfficeToPDF();
dok.dokument = officeToPDF.word_to_pdf(Docid, connectionstring, tempdir);
officeToPDF = null;
return dok;
}
}
catch { }
finally {
db1 = null;
}
dok.dokument = Convert_Word_To_PDF(dok.dokument.ToString(), pdfparameters);
dok.extension = "pdf";
return dok;