update 0250704
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user