update 20241217
This commit is contained in:
@@ -60,10 +60,12 @@ namespace DOCGEN.Generator
|
||||
DataTable dt = new DataTable();
|
||||
DataTable dt2 = new DataTable();
|
||||
string Apptype = "";
|
||||
string Extension = "";
|
||||
dt = db.Get_Vorlage_By_DokumentID(dokumentid,useoffice);
|
||||
db.dsdaten.Tables.Clear();
|
||||
dt2 = db.Get_ApplicationType_from_Vorlage(Convert.ToInt32(dt.Rows[0]["nr"].ToString()));
|
||||
Apptype = dt2.Rows[0][0].ToString();
|
||||
Extension = dt2.Rows[0][1].ToString();
|
||||
switch (Apptype.ToUpper())
|
||||
{
|
||||
case "DOCX": case "DOCM": case "DOC": case "DOT":
|
||||
@@ -76,7 +78,7 @@ namespace DOCGEN.Generator
|
||||
} else
|
||||
{
|
||||
OnDocOffice.clsWordEdit oo = new OnDocOffice.clsWordEdit("", "","");
|
||||
dok.dokument = oo.Generate_Word_in_Office(ref docdata, ref dok, dt.Rows[0][0].ToString(), connectionstring, tempdir, dokumentid, Apptype);
|
||||
dok.dokument = oo.Generate_Word_in_Office(ref docdata, ref dok, dt.Rows[0][0].ToString(), connectionstring, tempdir, dokumentid, Apptype,Extension);
|
||||
}
|
||||
|
||||
dok.doktype = "D";
|
||||
|
||||
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.
Binary file not shown.
@@ -17,6 +17,9 @@ using System.Runtime.Serialization;
|
||||
using System.Xml.Linq;
|
||||
using NLog.LayoutRenderers;
|
||||
using System.Configuration;
|
||||
using Syncfusion.DocIO;
|
||||
using Syncfusion.Pdf;
|
||||
using System.IO;
|
||||
|
||||
namespace DOCGEN
|
||||
{
|
||||
@@ -115,5 +118,30 @@ namespace DOCGEN
|
||||
sfword = null;
|
||||
return dok.dokument;
|
||||
}
|
||||
|
||||
//public void createpdf(string filename)
|
||||
//{
|
||||
// WordDocument document = new WordDocument(filename, FormatType.Automatic);
|
||||
// CompatibilityMode compatibilityMode = document.Settings.CompatibilityMode;
|
||||
// //document.UpdateDocumentFields();
|
||||
// //document.UpdateDocumentFields();
|
||||
// //TextSelection textSelection = document.Find("den Kunden", false, true);
|
||||
// //WTextRange textRange = textSelection.GetAsOneRange();
|
||||
// //Modifies the text
|
||||
// //textRange.Text = "Replaced text";
|
||||
// using (Syncfusion.DocToPDFConverter.DocToPDFConverter converter = new Syncfusion.DocToPDFConverter.DocToPDFConverter())
|
||||
// {
|
||||
// converter.Settings.EmbedFonts = true;
|
||||
// //converter.Settings.UpdateDocumentFields = true;
|
||||
// //converter.Settings.EnableAlternateChunks = true;
|
||||
// //converter.Settings.AutoDetectComplexScript = true;
|
||||
|
||||
// //Converts Word document into PDF document
|
||||
// using (PdfDocument pdfDocument = converter.ConvertToPDF(document))
|
||||
// {
|
||||
// pdfDocument.Save(filename + ".pdf");
|
||||
// }
|
||||
// };
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace DOCGEN
|
||||
}
|
||||
|
||||
|
||||
public string Convert_Word_To_PDF(string document, DataTable pdfparameters = null)
|
||||
public string Convert_Word_To_PDF(string document, DataTable pdfparameters = null, bool useseettings = false)
|
||||
{
|
||||
|
||||
//Dokument erstellen
|
||||
@@ -298,10 +298,12 @@ namespace DOCGEN
|
||||
using (Syncfusion.DocToPDFConverter.DocToPDFConverter converter = new Syncfusion.DocToPDFConverter.DocToPDFConverter())
|
||||
{
|
||||
converter.Settings.EmbedFonts = true;
|
||||
converter.Settings.UpdateDocumentFields = true;
|
||||
converter.Settings.EnableAlternateChunks = true;
|
||||
converter.Settings.AutoDetectComplexScript = true;
|
||||
|
||||
if (useseettings)
|
||||
{
|
||||
converter.Settings.UpdateDocumentFields = true;
|
||||
converter.Settings.EnableAlternateChunks = true;
|
||||
converter.Settings.AutoDetectComplexScript = true;
|
||||
}
|
||||
//Converts Word document into PDF document
|
||||
using (PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument))
|
||||
{
|
||||
@@ -457,13 +459,16 @@ namespace DOCGEN
|
||||
|
||||
//Initialize ExcelToPdfConverter
|
||||
ExcelToPdfConverter converter = new ExcelToPdfConverter(workbook);
|
||||
ExcelToPdfConverterSettings settings = new ExcelToPdfConverterSettings();
|
||||
settings.EmbedFonts = true;
|
||||
|
||||
|
||||
|
||||
//Initialize PDF document
|
||||
PdfDocument pdfDocument = new PdfDocument();
|
||||
|
||||
//Convert Excel document into PDF document
|
||||
pdfDocument = converter.Convert();
|
||||
pdfDocument = converter.Convert(settings);
|
||||
|
||||
//Save the converted PDF document
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user