update 20260406
This commit is contained in:
@@ -135,6 +135,7 @@ namespace DOCGEN
|
||||
return "P";
|
||||
}
|
||||
}
|
||||
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
@@ -357,18 +358,44 @@ namespace DOCGEN
|
||||
|
||||
public string Convert_Word_To_PDF(string document, DataTable pdfparameters = null, bool useseettings = false , bool updatefields=true)
|
||||
{
|
||||
|
||||
|
||||
|
||||
//Dokument erstellen
|
||||
var streamword = new MemoryStream(Convert.FromBase64String(document));
|
||||
WordDocument wordDocument = new WordDocument(streamword, Syncfusion.DocIO.FormatType.Automatic);
|
||||
wordDocument.Properties.Hyphenation.AutoHyphenation = true;
|
||||
|
||||
//wordDocument.Properties.Hyphenation.
|
||||
if (updatefields) { wordDocument.UpdateDocumentFields(); }
|
||||
//FileStream dictornyrystream = new FileStream(@"E:\Software-Projekte\OnDoc\OnDoc\Client\bin\Debug\hyph_de_CH.dic", FileMode.Open);
|
||||
|
||||
//FileStream dictornyrystream = new FileStream(AppDomain.CurrentDomain.BaseDirectory + @"\hyph_de_CH.dic", FileMode.Open, FileAccess.Read);
|
||||
//Hyphenator.Dictionaries.Add("de-CH", dictornyrystream);
|
||||
|
||||
|
||||
// Keine Parameter / Dokument als PDF konvertieren
|
||||
|
||||
//CultureInfo culture = new CultureInfo("de-CH");
|
||||
//CultureInfo.DefaultThreadCurrentCulture = culture;
|
||||
//CultureInfo.DefaultThreadCurrentUICulture = culture;
|
||||
//foreach (WSection section in wordDocument.Sections)
|
||||
//{
|
||||
// foreach (WParagraph para in section.Paragraphs)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// foreach (WTextRange textRange in para.ChildEntities)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// textRange.CharacterFormat.LocaleIdASCII = (short)culture.LCID;
|
||||
// textRange.CharacterFormat.LocaleIdFarEast = (short)culture.LCID;
|
||||
// textRange.CharacterFormat.LocaleIdBidi = (short)culture.LCID;
|
||||
// }
|
||||
// catch { }
|
||||
// }
|
||||
// }
|
||||
// catch { }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
if (pdfparameters == null)
|
||||
{
|
||||
using (Syncfusion.DocToPDFConverter.DocToPDFConverter converter = new Syncfusion.DocToPDFConverter.DocToPDFConverter())
|
||||
|
||||
Reference in New Issue
Block a user